当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript NgxsModule.forRoot方法代码示例

本文整理汇总了TypeScript中@ngxs/store.NgxsModule.forRoot方法的典型用法代码示例。如果您正苦于以下问题:TypeScript NgxsModule.forRoot方法的具体用法?TypeScript NgxsModule.forRoot怎么用?TypeScript NgxsModule.forRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ngxs/store.NgxsModule的用法示例。


在下文中一共展示了NgxsModule.forRoot方法的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();
 }));
开发者ID:strongbox,项目名称:strongbox-web-ui,代码行数:33,代码来源:manage-repository.component.spec.ts

示例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');
        });
    }));
开发者ID:strongbox,项目名称:strongbox-web-ui,代码行数:30,代码来源:browse-repository.component.spec.ts

示例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);
    }));
开发者ID:strongbox,项目名称:strongbox-web-ui,代码行数:30,代码来源:error.interceptor.spec.ts

示例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();
    });
开发者ID:strongbox,项目名称:strongbox-web-ui,代码行数:28,代码来源:confirm.dialog.component.spec.ts

示例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();
 }));
开发者ID:strongbox,项目名称:strongbox-web-ui,代码行数:28,代码来源:storage-form.dialog.component.spec.ts

示例6: beforeEach

 beforeEach(async(() => {
     TestBed.configureTestingModule({
         imports: [
             RouterTestingModule,
             BrowserAnimationsModule,
             MaterialModule,
             LayoutModule,
             HttpClientTestingModule,
             NgxsModule.forRoot([]),
         ],
         declarations: [BrowseComponent]
     }).compileComponents();
 }));
开发者ID:strongbox,项目名称:strongbox-web-ui,代码行数:13,代码来源:browse.component.spec.ts

示例7: beforeEach

 beforeEach(() => {
   TestBed.configureTestingModule({
     declarations: [DashboardComponent],
     imports: [
       ReactiveFormsModule,
       NgxsModule.forRoot([
         ObsState,
         ScenesState,
         SourcesState,
         TransitionState
       ])
     ]
   });
 });
开发者ID:chgc,项目名称:stream-tools,代码行数:14,代码来源:dashboard.component.spec.ts

示例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();
 }));
开发者ID:chgc,项目名称:stream-tools,代码行数:15,代码来源:panel-edit.component.spec.ts

示例9: beforeEach

  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [
        EditableGuard,
        { provide: AngularFirestore, useValue: FakeAngularFirestore }
      ],
      imports: [
        HttpClientTestingModule,
        RouterTestingModule,
        NgxsModule.forRoot([EnvironmentState])
      ]
    });

    guard = TestBed.get(EditableGuard);
  });
开发者ID:chgc,项目名称:stream-tools,代码行数:15,代码来源:editable.guard.spec.ts

示例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);
    });
开发者ID:strongbox,项目名称:strongbox-web-ui,代码行数:15,代码来源:manage-settings.guard.spec.ts


注:本文中的@ngxs/store.NgxsModule.forRoot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。