-
Notifications
You must be signed in to change notification settings - Fork 1
TranslitModule
Moe Myat Zaw edited this page Jun 7, 2019
·
1 revision
The transliteration NGMODULE
for TranslitService.
export class TranslitModule {
static forRootWithOptions(options: TranslitOptions): ModuleWithProviders
static forChildWithOptions(options: TranslitOptions): ModuleWithProviders
}
Call this method to provide options for configuring the TranslitModule
in root app module.
static forRootWithOptions(
options: TranslitOptions = { shareCachedRules: true }): ModuleWithProviders
-
options
- An object of configuration options of typeTranslitOptions
.
/**
* The TranslitOptions interface.
*/
export interface TranslitOptions {
/**
* Default `true`, if true provide `TranslitRuleStore` to share cache rules across modules.
*/
shareCachedRules?: boolean;
/**
* If true, conversion trace information will be included in the transliteration result.
*/
trace?: boolean;
}
Call this method to provide options for configuring the TranslitModule
in child modules.
static forRootWithOptions(
options: TranslitOptions = { shareCachedRules: true }): ModuleWithProviders
-
TranslitService
- TheTranslitService
class is a core transliteration service for swapping letters from one script to another and it will be provided by default. -
TranslitRuleStore
- TheTranslitRuleStore
service class to store loaded rules in application scope which will be provided when calling eitherforRootWithOptions
orforChildWithOptions
static method withshareCachedRules
=true
option.
import { TranslitModule } from '@dagonmetric/ng-translit';
@NgModule({
imports: [
// Other module imports
// ng-translit
TranslitModule
]
})
export class AppModule { }
import { TranslitModule } from '@dagonmetric/ng-translit';
@NgModule({
imports: [
// Other module imports
// ng-translit
TranslitModule.forRootWithOptions({ trace: true })
]
})
export class AppModule { }
import { TranslitModule } from '@dagonmetric/ng-translit';
@NgModule({
imports: [
// Other module imports
// ng-translit
TranslitModule.forChildWithOptions({ shareCachedRules: true })
]
})
export class ChildModule { }