Home > Back-end >  Remove accents/diacritics in a string in Angular Probleme with IE 11
Remove accents/diacritics in a string in Angular Probleme with IE 11

Time:10-22

i try to use String.normalize("NFD").replace(/[\u0300-\u036f]/g, "") but i have this error in IE11

ERROR TypeError: L’objet ne gère pas la propriété ou la méthode « normalize »

CodePudding user response:

You got the error in IE 11 because IE doesn't support normalize.

You need to use polyfill to support normalize in IE 11. You can use module unorm to provide support for normalize in IE 11.

  1. Run npm install unorm.
  2. Use import 'unorm'; at the file where you write the normalize function.
  • Related