本文整理匯總了TypeScript中ng2-toastr.ToastModule.forRoot方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastModule.forRoot方法的具體用法?TypeScript ToastModule.forRoot怎麽用?TypeScript ToastModule.forRoot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng2-toastr.ToastModule
的用法示例。
在下文中一共展示了ToastModule.forRoot方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: describe
describe('PoolListComponent', () => {
let component: PoolListComponent;
let fixture: ComponentFixture<PoolListComponent>;
configureTestBed({
declarations: [PoolListComponent, MirrorHealthColorPipe],
imports: [
SharedModule,
BsDropdownModule.forRoot(),
TabsModule.forRoot(),
ProgressbarModule.forRoot(),
HttpClientTestingModule,
RouterTestingModule,
ToastModule.forRoot()
],
providers: i18nProviders
});
beforeEach(() => {
fixture = TestBed.createComponent(PoolListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
示例2: describe
describe('RbdListComponent', () => {
let component: RbdListComponent;
let fixture: ComponentFixture<RbdListComponent>;
configureTestBed({
imports: [
SharedModule,
BsDropdownModule.forRoot(),
TabsModule.forRoot(),
ModalModule.forRoot(),
TooltipModule.forRoot(),
ToastModule.forRoot(),
AlertModule.forRoot(),
ComponentsModule,
RouterTestingModule,
HttpClientTestingModule
],
declarations: [RbdListComponent, RbdDetailsComponent, RbdSnapshotListComponent]
});
beforeEach(() => {
fixture = TestBed.createComponent(RbdListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
示例3: describe
describe('UserTabsComponent', () => {
let component: UserTabsComponent;
let fixture: ComponentFixture<UserTabsComponent>;
configureTestBed({
imports: [
SharedModule,
ToastModule.forRoot(),
TabsModule.forRoot(),
RouterTestingModule,
HttpClientTestingModule
],
declarations: [UserTabsComponent]
});
beforeEach(() => {
fixture = TestBed.createComponent(UserTabsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
示例4: describe
describe('RbdSnapshotFormComponent', () => {
let component: RbdSnapshotFormComponent;
let fixture: ComponentFixture<RbdSnapshotFormComponent>;
configureTestBed({
imports: [
ReactiveFormsModule,
ComponentsModule,
HttpClientTestingModule,
ServicesModule,
ApiModule,
ToastModule.forRoot(),
RouterTestingModule
],
declarations: [RbdSnapshotFormComponent],
providers: [BsModalRef, BsModalService, AuthStorageService, i18nProviders]
});
beforeEach(() => {
fixture = TestBed.createComponent(RbdSnapshotFormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
示例5: describe
describe('RbdImagesComponent', () => {
let component: RbdImagesComponent;
let fixture: ComponentFixture<RbdImagesComponent>;
configureTestBed({
declarations: [
RbdDetailsComponent,
RbdImagesComponent,
RbdListComponent,
RbdSnapshotListComponent,
RbdTrashListComponent,
RbdConfigurationListComponent
],
imports: [
HttpClientTestingModule,
RouterTestingModule,
SharedModule,
TabsModule.forRoot(),
ToastModule.forRoot(),
TooltipModule.forRoot()
],
providers: [TaskListService, i18nProviders]
});
beforeEach(() => {
fixture = TestBed.createComponent(RbdImagesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
示例6: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule, ToastModule.forRoot()],
declarations: [AppComponent],
schemas: [NO_ERRORS_SCHEMA],
providers: [{ provide: AuthStorageService, useValue: fakeService }]
}).compileComponents();
}));
示例7: describe
describe('RbdFormComponent', () => {
let component: RbdFormComponent;
let fixture: ComponentFixture<RbdFormComponent>;
let activatedRoute: ActivatedRouteStub;
configureTestBed({
imports: [
HttpClientTestingModule,
ReactiveFormsModule,
RouterTestingModule,
ToastModule.forRoot(),
SharedModule
],
declarations: [RbdFormComponent],
providers: [
{
provide: ActivatedRoute,
useValue: new ActivatedRouteStub({ pool: 'foo', name: 'bar', snap: undefined })
},
i18nProviders
]
});
beforeEach(() => {
fixture = TestBed.createComponent(RbdFormComponent);
component = fixture.componentInstance;
activatedRoute = TestBed.get(ActivatedRoute);
});
it('should create', () => {
expect(component).toBeTruthy();
});
describe('should test decodeURIComponent of params', () => {
let rbdService: RbdService;
beforeEach(() => {
rbdService = TestBed.get(RbdService);
component.mode = RbdFormMode.editing;
fixture.detectChanges();
spyOn(rbdService, 'get').and.callThrough();
});
it('without snapName', () => {
activatedRoute.setParams({ pool: 'foo%2Ffoo', name: 'bar%2Fbar', snap: undefined });
expect(rbdService.get).toHaveBeenCalledWith('foo/foo', 'bar/bar');
expect(component.snapName).toBeUndefined();
});
it('with snapName', () => {
activatedRoute.setParams({ pool: 'foo%2Ffoo', name: 'bar%2Fbar', snap: 'baz%2Fbaz' });
expect(rbdService.get).toHaveBeenCalledWith('foo/foo', 'bar/bar');
expect(component.snapName).toBe('baz/baz');
});
});
});
示例8: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
ToastModule.forRoot()
],
declarations: [
AppComponent
],
}).compileComponents();
}));
示例9: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
SharedModule,
ToastModule.forRoot(),
TabsModule.forRoot(),
RouterTestingModule,
HttpClientTestingModule
],
declarations: [RoleDetailsComponent]
}).compileComponents();
}));
示例10: async
async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
CoreModule,
SharedModule,
ToastModule.forRoot(),
ClusterModule,
BlockModule
],
declarations: [AppComponent]
}).compileComponents();
})