本文整理匯總了TypeScript中@ngxs/store.NgxsModule類的典型用法代碼示例。如果您正苦於以下問題:TypeScript NgxsModule類的具體用法?TypeScript NgxsModule怎麽用?TypeScript NgxsModule使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了NgxsModule類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
BrowserModule,
RouterTestingModule,
DragDropModule,
MaterialModule,
FormsModule,
FormHelperModule,
LayoutModule,
ReactiveFormsModule,
HttpClientTestingModule,
NgxsModule.forRoot([AppState, SessionState]),
NgxsFormPluginModule,
NgProgressModule,
NgProgressHttpModule,
NoopAnimationsModule,
ToastrModule.forRoot(),
],
providers: [
{
provide: ActivatedRoute,
useValue: {
paramMap: of(convertToParamMap({
storageId: 'storage-id',
type: RepositoryTypeEnum.HOSTED.toLowerCase()
}))
}
}
],
declarations: [ManageRepositoryComponent]
}).compileComponents();
}));
示例2: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
BrowserAnimationsModule,
MaterialModule,
LayoutModule,
HttpClientTestingModule,
NgxsModule.forRoot([]),
RouterTestingModule.withRoutes([
{
path: 'admin/storages/:storageId/:repositoryId',
children: [
{
path: '**',
component: BrowseRepositoryComponent
}
]
},
])
],
declarations: [BrowseRepositoryComponent]
}).compileComponents();
router = TestBed.get(Router);
ngZone = TestBed.get(NgZone);
ngZone.run(() => {
router.initialNavigation();
router.navigateByUrl('admin/storages/myStorageId/myRepositoryId/some/long/path');
});
}));
示例3: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
RouterTestingModule,
BrowserAnimationsModule,
MaterialModule,
NgxsModule.forRoot([SessionState]),
NgxsFormPluginModule.forRoot(),
ToastrModule.forRoot(),
],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: ErrorInterceptor,
multi: true,
}
]
});
interceptor = TestBed.get(ErrorInterceptor);
toastr = TestBed.get(ToastrService);
toastrSpy = spyOn(toastr, 'error').and.callThrough();
backend = TestBed.get(HttpTestingController);
client = TestBed.get(HttpClient);
store = TestBed.get(Store);
actions = TestBed.get(Actions);
}));
示例4: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
NoopAnimationsModule,
MaterialModule,
HttpClientTestingModule,
NgxsModule.forRoot([AppState]),
ReactiveFormsModule
],
declarations: [ConfirmDialogComponent],
providers: [
{provide: MAT_DIALOG_DATA, useValue: {}},
{
provide: MatDialogRef, useValue: {
afterClosed: () => of(null),
backdropClick: () => of(null),
close: () => of(null),
updateSize: () => of(null)
}
}
]
});
fixture = TestBed.createComponent(ConfirmDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
示例5: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
NoopAnimationsModule,
RouterTestingModule,
MaterialModule,
FormsModule,
FormHelperModule,
ReactiveFormsModule,
HttpClientTestingModule,
NgxsModule.forRoot([AppState, BrowseStoragesState]),
ToastrModule.forRoot()
],
providers: [
StorageManagerService,
{provide: MAT_DIALOG_DATA, useValue: {}},
{
provide: MatDialogRef, useValue: {
afterClosed: () => of(null),
backdropClick: () => of(null),
close: () => of(null),
updateSize: () => of(null)
}
}
],
declarations: [StorageFormDialogComponent]
}).compileComponents();
}));
示例6: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule,
BrowserAnimationsModule,
MaterialModule,
LayoutModule,
HttpClientTestingModule,
NgxsModule.forRoot([]),
],
declarations: [BrowseComponent]
}).compileComponents();
}));
示例7: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [DashboardComponent],
imports: [
ReactiveFormsModule,
NgxsModule.forRoot([
ObsState,
ScenesState,
SourcesState,
TransitionState
])
]
});
});
示例8: beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [PanelEditComponent],
imports: [
ReactiveFormsModule,
AceEditorModule,
NgxsModule.forRoot([EnvironmentState, CaptionItemsState])
],
providers: [
{ provide: AuthService, useValue: FakeAuthService },
{ provide: CaptionService, useValue: fakeCaptionService },
{ provide: AngularFirestore, useValue: AngularFirestoreSpy }
]
}).compileComponents();
}));
示例9: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
EditableGuard,
{ provide: AngularFirestore, useValue: FakeAngularFirestore }
],
imports: [
HttpClientTestingModule,
RouterTestingModule,
NgxsModule.forRoot([EnvironmentState])
]
});
guard = TestBed.get(EditableGuard);
});
示例10: beforeEach
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
NgxsModule.forRoot([SessionState]),
],
providers: [
ManageSettingsGuard,
AuthService
]
}).compileComponents(); // compile template and css
guard = TestBed.get(ManageSettingsGuard);
store = TestBed.get(Store);
});