當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript StoreModule.forFeature方法代碼示例

本文整理匯總了TypeScript中@ngrx/store.StoreModule.forFeature方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript StoreModule.forFeature方法的具體用法?TypeScript StoreModule.forFeature怎麽用?TypeScript StoreModule.forFeature使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ngrx/store.StoreModule的用法示例。


在下文中一共展示了StoreModule.forFeature方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: beforeEach

 beforeEach(async(() => {
   TestBed.configureTestingModule({
     imports: [
       BrowserModule,
       StoreModule.forRoot({ routerReducer }),
       EffectsModule.forRoot([ IdentityEffects ]),
       StoreDevtoolsModule.instrument({ maxAge: 50 }),
       BrowserAnimationsModule,
       FormsModule,
       CoreModule.forRoot([
         { provide: WindowService, useFactory: (win) },
         { provide: ConsoleService, useFactory: (cons) },
         { provide: LogTarget, useFactory: (consoleLogTarget), deps: [ ConsoleService ], multi: true },
       ]),
       RouterModule.forRoot(routes),
       MultilingualModule.forRoot(TEST_MULTILINGUAL_PROVIDERS),
       SampleModule,
       DialogModule,
       IdentityModule,
       StoreRouterConnectingModule,
       StoreModule.forFeature('sidebar', sidebarReducer),
       StoreModule.forFeature('toolbar', toolbarReducer),
       MATERIAL_MODULES,
       FlexLayoutModule,
       PLUGIN_MODULES,
     ],
     declarations: [
       AppComponent,
     ],
     providers: [
       { provide: APP_BASE_HREF, useValue: '/' },
     ],
   }).compileComponents();
 }));
開發者ID:our-city-app,項目名稱:gae-plugin-framework,代碼行數:34,代碼來源:app.component.spec.ts

示例2: beforeEach

	beforeEach(() => {
		TestBed.configureTestingModule({
			imports: [StoreModule.forRoot([]), StoreModule.forFeature('search', fromSearch.search)],
			providers: [SearchQueryResolver]
		});
		resolver = TestBed.get(SearchQueryResolver);
	});
開發者ID:davinkevin,項目名稱:Podcast-Server,代碼行數:7,代碼來源:search-query.resolver.spec.ts

示例3: platformBrowserDynamicTesting

const testModuleConfig = () => {
  TestBed.resetTestEnvironment();

  TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting())
    .configureTestingModule({
      imports: [
        RouterTestingModule,
        StoreModule.forFeature('i18n', reducers),
        EffectsModule.forFeature([LanguageEffects]),
        CoreModule.forRoot([
          {
            provide: ConfigLoader,
            useFactory: configFactory,
            deps: [
              PLATFORM_ID,
              HttpClient
            ]
          }
        ]),
        CoreTestingModule,
        NgrxTestingModule,
        AnalyticsModule,
        I18NTestingModule
      ],
      providers: [
        LanguageEffects
      ]
    });
};
開發者ID:John123Yu,項目名稱:universal-1,代碼行數:29,代碼來源:language.effects.spec.ts

示例4: beforeEach

  beforeEach(async(() => {
    // @ts-ignore
    TestBed.configureTestingModule({
      declarations: [SearchComponent],
      imports: [
        ReactiveFormsModule,
        RouterTestingModule,

        NoopAnimationsModule,
        MatCardModule,
        MatButtonModule,
        MatIconModule,
        MatInputModule,
        MatSelectModule,
        MatPaginatorModule,
        MatToolbarModule,

        ToolbarModule,

        TruncateModule,

        StoreModule.forRoot([]),
        StoreModule.forFeature('search', fromSearch.search)
      ]
    }).compileComponents();
  }));
開發者ID:davinkevin,項目名稱:Podcast-Server,代碼行數:26,代碼來源:search.component.spec.ts

示例5: beforeEach

	beforeEach(() => {
		TestBed.configureTestingModule({
			imports: [StoreModule.forRoot([]), StoreModule.forFeature('podcast', reducer)],
			providers: [PodcastResolver]
		});

		resolver = TestBed.get(PodcastResolver);
	});
開發者ID:davinkevin,項目名稱:Podcast-Server,代碼行數:8,代碼來源:podcast.resolver.spec.ts

示例6: beforeEach

	beforeEach(() => {
		TestBed.configureTestingModule({
			imports: [StoreModule.forRoot([]), StoreModule.forFeature('podcasts', reducer)],
			providers: [PodcastsResolver, { provide: PodcastService, useValue: podcastService }]
		});

		resolver = TestBed.get(PodcastsResolver);
	});
開發者ID:davinkevin,項目名稱:Podcast-Server,代碼行數:8,代碼來源:podcasts.resolver.spec.ts

示例7: async

			async(() => {
				TestBed.configureTestingModule({
					imports: [
						MatToolbarModule,
						MatIconModule,
						RouterTestingModule,

						ToolbarModule,
						/* NgRx */
						StoreModule.forRoot({}),
						StoreModule.forFeature('podcasts', fromPodcasts.reducer)
					],
					declarations: [PodcastsComponent]
				}).compileComponents();
			})
開發者ID:davinkevin,項目名稱:Podcast-Server,代碼行數:15,代碼來源:podcasts.component.spec.ts

示例8: async

		async(() => {
			TestBed.configureTestingModule({
				declarations: [EpisodesComponent],
				imports: [
					MatListModule,
          MatPaginatorModule,
          RouterTestingModule.withRoutes([]),

					StoreModule.forRoot({}),
					StoreModule.forFeature('podcast', fromPodcast.reducer),

					RouterTestingModule
				],
			}).compileComponents();

			datePipe = new DatePipe('en-US');
		})
開發者ID:davinkevin,項目名稱:Podcast-Server,代碼行數:17,代碼來源:episodes.component.spec.ts

示例9: async

		async(() => {
			TestBed.configureTestingModule({
				declarations: [PodcastComponent],
				imports: [
					MatIconModule,
					MatButtonModule,
					MatMenuModule,
					MatToolbarModule,

					ToolbarModule,

					StoreModule.forRoot({}),
					StoreModule.forFeature('podcast', fromPodcast.reducer),

					RouterTestingModule
				],
				providers: [{ provide: ActivatedRoute, useValue: { data: of({ podcast: PODCAST }) } }]
			}).compileComponents();
		})
開發者ID:davinkevin,項目名稱:Podcast-Server,代碼行數:19,代碼來源:podcast.component.spec.ts

示例10: beforeEach

  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        ReactiveFormsModule,
        RouterTestingModule,
        HttpModule,
        NoopAnimationsModule,
        DataListModule,
        StoreModule.forRoot(reducers),
        StoreRouterConnectingModule.forRoot({
          stateKey: 'router'
        }),
        EffectsModule.forRoot([RoutingEffects]),
        StoreModule.forFeature('users', usersReducer),
        EffectsModule.forFeature([UserEffects])
      ],
      providers: [ LoggerService,
        { provide: ActivatedRoute, useClass: ActivatedRouteStub },
        { provide: UserService, useValue: spyUserService },
        { provide: LoginService, useClass: LoginServiceStub },
        { provide: API_BASE_URL, useValue: '/api' },
        UserActions,
        UserResolver,
      ],
      declarations: [UserListComponent]
    });

    // Create component
    fixture = TestBed.createComponent(UserListComponent);
    comp = fixture.componentInstance;

    // Get BackendService actually injected into the component
    // userService = TestBed.get(UserService);
    userService = fixture.debugElement.injector.get(UserService);

    // Setup spy on the `getQuote` method
    // spy1 = spyOn(userService, 'findAllUsers').and.returnValue(Observable.of(testUsers));

    // Get the tested element by CSS selector (e.g., by class name)
    de = fixture.debugElement.query(By.css('ul'));
    el = de.nativeElement;
  });
開發者ID:iproduct,項目名稱:course-angular,代碼行數:42,代碼來源:user-list.component.spec.ts


注:本文中的@ngrx/store.StoreModule.forFeature方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。