本文整理汇总了TypeScript中@ngx-translate/core.TranslateModule.forRoot方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TranslateModule.forRoot方法的具体用法?TypeScript TranslateModule.forRoot怎么用?TypeScript TranslateModule.forRoot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ngx-translate/core.TranslateModule
的用法示例。
在下文中一共展示了TranslateModule.forRoot方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
IonicModule.forRoot(AppComponent),
RouterTestingModule,
TranslateModule.forRoot(),
CoreModule
],
declarations: [AppComponent],
providers: []
});
TestBed.compileComponents();
});
示例2: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
Angulartics2Module.forRoot([Angulartics2GoogleAnalytics]),
RouterTestingModule,
TranslateModule.forRoot(),
CoreModule
],
declarations: [AppComponent],
providers: []
});
TestBed.compileComponents();
}));
示例3: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MaterialModule,
TranslateModule.forRoot({
loader: {provide: TranslateLoader, useClass: FakeLoader}
})
],
declarations: [ AppComponent ], // declare the test component
schemas: [ NO_ERRORS_SCHEMA ],
providers: [ TranslateService, TranslatePipe ],
}).compileComponents();
}));
示例4: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot(),
PipesModule,
IonicStorageModule.forRoot(),
RouterTestingModule.withRoutes([])
],
declarations: [ObservationsLocalPage],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [HttpClient, HttpHandler, HTTP, Network, File]
}).compileComponents();
}));
示例5: beforeEach
beforeEach(async(() => {
spyOn(mocks.profileService, "getCurrentProfile").and.returnValue(Promise.resolve(profile));
TestBed.configureTestingModule({
imports: [RouterTestingModule, TranslateModule.forRoot(), NgPipesModule],
declarations: [ProfileAboutComponent],
providers: [
{ provide: ProfileService, useValue: mocks.profileService },
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
});
fixture = TestBed.createComponent(ProfileAboutComponent);
component = fixture.componentInstance;
}));
示例6: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ImageUploadComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [ModalModule.forRoot(), TranslateModule.forRoot()],
providers: [
{ provide: TranslatorService, useValue: translatorService },
]
}).compileComponents().then(() => {
fixture = TestBed.createComponent(ImageUploadComponent);
component = fixture.componentInstance;
});
}));
示例7: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
ReactiveFormsModule,
TranslateModule.forRoot(),
IonicStorageModule.forRoot(),
RouterTestingModule.withRoutes([])
],
declarations: [SignupPage],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [HttpClient, HttpHandler, HTTP, Network, GooglePlus]
}).compileComponents();
}));
示例8: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [QuizzesComponent,
MockQuizConfigurationComponent,
MockQuizGameComponent],
imports: [
TranslateModule.forRoot({
loader: { provide: TranslateLoader, useClass: FakeLoader },
})
]
})
.compileComponents();
}));
示例9: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ ReactiveFormsModule,
TranslateModule.forRoot({loader: {provide: TranslateLoader, useClass: TranslateFakeLoader}})],
// providers: [ {provide: TranslateService, use: FakeTranslateService}]
// imports: [TranslateModule.forRoot()], providers: []
providers: [ { provide: LoginService, use: loginServiceStub } ]
});
injector = getTestBed();
// translate = injector.get(TranslateService);
});
示例10: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
NgbModule.forRoot(),
RouterTestingModule,
TranslateModule.forRoot(),
ReactiveFormsModule,
CoreModule
],
declarations: [LoginComponent]
})
.compileComponents();
}));