Angularjs directive and angularjs filter; which use latinize.js to convert accents (diacritics) from strings to latin characters.
npm install ng-latinize
bower install ng-latinize
- Using as directive and filter.
- Delete inappropriate characters
- Capitalization option.
- Add latinize.js and ng-latinize.js to your source.
<script src="bower_components/latinize/latinize.js"></script>
<script src="bower_components/ng-latinize/dist/ng-latinize.js"></script>
- Add ng-latinize directive to your input element.
<input type="text" ng-model="test" ng-latinize />
- Add ngLatinize filter anywhere you need.
{{ text | ngLatinize }}
- Add capitalize param to your input or variable
<input type="text" ng-model="test" data-capitalize="true" ng-latinize />
{{ anothertext | ngLatinize:true }}
If you enter ỆᶍǍᶆṔƚÉ áéíóúýčďěňřšťžů to the input below.
<input type="text" ng-model="accentedLetter" />
{{ accentedLetter | ngLatinize:true }}
It will convert the string to EXAMPLE AEIOUYCDENRSTZU.
MIT license.