Package Exports
- angular2latinize
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angular2latinize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
angular2latinize
Angular 2 simple latinize service for removing accents from latin characters, also for ionic 2 applications.
installation
npm install angular2latinizeusage
my-class.ts
import { Latinize } from 'angular2latinize';
export class myClass {
constructor (
public latinize: Latinize
) {
console.log('latinize "crème brûlée" -> ', this.latinize.convert('crème brûlée')); // results 'creme brulee'
}
}app-module.ts
import { NgModule } from '@angular/core';
import { Latinize } from 'angular2latinize';
@NgModule({
// ...
providers: [
Latinize
]
})
export class AppModule {}Extending characters map
You can use the Latinize.charmap object to access the translation dictionary or to change the mapping
Latinize.charmap['Ω'] = 'O';
// modify the behavior for German umlauts
_.extend(Latinize.charmap,
{'Ä': 'Ae', 'Ä': 'Ae', 'Ü': 'Ue', 'ä': 'ae', 'ö': 'oe', 'ü': 'ue'});