本文整理匯總了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();
}));