本文整理汇总了TypeScript中ng2-translate/ng2-translate.TranslateModule类的典型用法代码示例。如果您正苦于以下问题:TypeScript TranslateModule类的具体用法?TypeScript TranslateModule怎么用?TypeScript TranslateModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TranslateModule类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [StudentsComponent],
imports: [TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [Http]
})],
providers: [AngularService],
schemas: []
});
TestBed.compileComponents();
});
开发者ID:daniviles,项目名称:classpip-dashboard,代码行数:13,代码来源:students.component.spec.ts
示例2: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpModule, TranslateModule.forRoot({
provide: TranslateLoader,
useClass: AlfrescoTranslationLoader
})],
providers: [
AlfrescoTranslationService,
{provide: XHRBackend, useClass: MockBackend}
]
});
injector = getTestBed();
backend = injector.get(XHRBackend);
alfrescoTranslationService = injector.get(AlfrescoTranslationService);
backend.connections.subscribe((c: MockConnection) => connection = c);
alfrescoTranslationService.addTranslationFolder('fake-name', 'fake-path');
});
开发者ID:Pokhriyal,项目名称:alfresco-ng2-components,代码行数:17,代码来源:AlfrescoTranslation.service.spec.ts
示例3: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent,
AlertComponent,
LoginComponent,
HomeComponent,
StudentsComponent,
// pipes
OrderByIdPipe,
OrderByNamePipe,
OrderBySurnamePipe
],
imports: [
NgbModule.forRoot(),
BrowserModule,
FormsModule,
HttpModule,
routing,
TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [Http]
})
],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' },
AuthGuard,
AlertService,
AngularService,
AvatarService,
GradeService,
GroupService,
LoginService,
MatterService,
SchoolService,
UserService,
UtilsService
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
});
TestBed.compileComponents();
});
开发者ID:daniviles,项目名称:classpip-dashboard,代码行数:43,代码来源:app.component.spec.ts
示例4: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [LoginComponent, HomeComponent, StudentsComponent],
imports: [
TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [Http]
}),
FormsModule,
routing
],
providers: [
{ provide: APP_BASE_HREF, useValue: '/' },
AlertService,
AngularService,
],
schemas: []
});
TestBed.compileComponents();
});
开发者ID:daniviles,项目名称:classpip-dashboard,代码行数:21,代码来源:login.component.spec.ts
示例5: translateLoaderFactory
{
useHash: config.useHashRouting,
enableTracing: config.traceRoutes,
// errorHandler: error => console.log(`[ROUTER ERROR] : ${error}`),
preloadingStrategy: PreloadAllModules
})
];
export function translateLoaderFactory(http: Http) {
return new TranslateStaticLoader(http, 'assets/i18n', '.json');
}
const VENDOR_MODULES = [
TranslateModule.forRoot({
// provide: TranslateLoader,
// useClass: TranslationProvider
provide: TranslateLoader, deps: [Http],
useFactory: translateLoaderFactory
})
];
export {
ENV_PROVIDERS,
ENV_MODULES,
VENDOR_MODULES,
APP_PROVIDERS,
BIB_DIRECTIVES,
BIB_ACTIONS,
BIB_EFFECTS,
APP_DECLARATIONS
};
开发者ID:asiddeen,项目名称:BiB,代码行数:31,代码来源:providers.ts
示例6:
const testModuleConfig = () => {
TestBed.configureTestingModule({
imports: [FormsModule, RouterModule, TranslateModule.forRoot()]
});
};
开发者ID:ivannugo,项目名称:angular2-seed-advanced,代码行数:5,代码来源:home.component.spec.ts
注:本文中的ng2-translate/ng2-translate.TranslateModule类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论