本文整理匯總了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,