本文整理汇总了TypeScript中@ngx-translate/core.TranslateModule类的典型用法代码示例。如果您正苦于以下问题:TypeScript TranslateModule类的具体用法?TypeScript TranslateModule怎么用?TypeScript TranslateModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TranslateModule类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
// vendor dependencies
import { TranslateModule } from '@ngx-translate/core';
// app
import { SharedModule } from '../shared';
import { RouterModule } from '../common';
import { RaveRoutingModule } from './rave-routing.module';
import { RaveComponent } from './components/rave/rave.component';
export const SHARED_MODULES: any[] = [
SharedModule,
RaveRoutingModule,
TranslateModule.forChild(),
];
export const COMPONENT_DECLARATIONS: any[] = [
RaveComponent
];
示例2:
// Enable Ionic's runtime error handling during development
{ provide: ErrorHandler, useClass: IonicErrorHandler },
];
}
/*******************************************************************************
* imports
*/
export let imports: any = [
ChartModule,
ColorPickerModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [ Http ],
},
}),
IonicStorageModule.forRoot({
name: 'governessdb',
storeName: 'governessdata',
driverOrder: ['indexeddb', 'sqlite', 'websql'],
}),
IonicModule.forRoot(GovernessApp, {
mode: 'md',
menuType: 'overlay',
activator: 'ripple',
}),
];
示例3: HttpLoaderFactory
];
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, OTranslateService.ASSETS_PATH, OTranslateService.ASSETS_EXTENSION);
}
export const INTERNAL_ONTIMIZE_MODULES: any = [
HttpModule,
HttpClientModule,
// Ngx-translate
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
OSharedModule,
// Ontimize modules
OBarMenuModule,
OBarMenuGroupModule,
OBarMenuItemModule,
OLocaleBarMenuItemModule,
OBarMenuSeparatorModule,
OBreadcrumbModule,
OButtonModule,
OCheckboxModule,