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


TypeScript EffectsModule.forFeature方法代码示例

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


在下文中一共展示了EffectsModule.forFeature方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: 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

示例2: 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/effects.EffectsModule.forFeature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。