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


TypeScript ReflectiveInjector.resolveAndCreate方法代码示例

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


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

示例1: beforeEach

 beforeEach(() => {
     injector = ReflectiveInjector.resolveAndCreate([
         AlfrescoSettingsService,
         AlfrescoApiService,
         AlfrescoAuthenticationService,
         UploadService
     ]);
 });
开发者ID:Pokhriyal,项目名称:alfresco-ng2-components,代码行数:8,代码来源:upload.service.spec.ts

示例2: serverBootstrap

export function serverBootstrap(
    appComponentType: Type,
    customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
  reflector.reflectionCapabilities = new ReflectionCapabilities();
  let providers = [SERVER_APPLICATION_PROVIDERS, customProviders || []];
  var appInjector = ReflectiveInjector.resolveAndCreate(providers, serverPlatform().injector);
  return coreLoadAndBootstrap(appComponentType, appInjector);
}
开发者ID:alexbecker,项目名称:angular,代码行数:8,代码来源:server.ts

示例3: makeLocation

 function makeLocation(
     baseHref: string = '/my/app', provider: any = /*@ts2dart_const*/[]): Location {
   locationStrategy = new MockLocationStrategy();
   locationStrategy.internalBaseHref = baseHref;
   let injector = ReflectiveInjector.resolveAndCreate(
       [Location, {provide: LocationStrategy, useValue: locationStrategy}, provider]);
   return location = injector.get(Location);
 }
开发者ID:4vanger,项目名称:angular,代码行数:8,代码来源:location_spec.ts

示例4: GET_HTTP_PROVIDERS_INJECTOR

export function GET_HTTP_PROVIDERS_INJECTOR(additionalProviders?: any[]): ReflectiveInjector {
  
  if (additionalProviders) {
    providers = providers.concat(additionalProviders);
  }  

  return ReflectiveInjector.resolveAndCreate(providers);  
}
开发者ID:Adam-Michalski,项目名称:angular2-seed-advanced,代码行数:8,代码来源:http.ts

示例5: beforeEach

 beforeEach(function() {
   const injector = ReflectiveInjector.resolveAndCreate([
     MATCH_ROUTE_PROVIDERS,
     RESOURCE_LOADER_PROVIDERS,
     provide(ROUTES, { useValue: routes })
   ]);
   traverser = injector.get(RouteTraverser);
 });
开发者ID:CoderMonkies,项目名称:router,代码行数:8,代码来源:route-traverser.spec.ts

示例6: bootstrapApp

export function bootstrapApp(
    appComponentType: Type,
    customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
  var appInjector = ReflectiveInjector.resolveAndCreate(
      [WORKER_APP_DYNAMIC_APPLICATION_PROVIDERS, isPresent(customProviders) ? customProviders : []],
      workerAppPlatform().injector);
  return coreLoadAndBootstrap(appInjector, appComponentType);
}
开发者ID:Trendy,项目名称:angular,代码行数:8,代码来源:worker_app.ts

示例7: bootstrap

export function bootstrap(
    appComponentType: Type,
    customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
  reflector.reflectionCapabilities = new ReflectionCapabilities();
  var appInjector = ReflectiveInjector.resolveAndCreate(
      [BROWSER_APP_PROVIDERS, isPresent(customProviders) ? customProviders : []],
      browserPlatform().injector);
  return coreLoadAndBootstrap(appInjector, appComponentType);
}
开发者ID:AAAnderson7301,项目名称:angular,代码行数:9,代码来源:browser.ts

示例8: beforeEach

    beforeEach(() => {

      injector = ReflectiveInjector.resolveAndCreate([
        StoreModule.provideStore({ todos, todoCount }).providers
      ]);

      store = injector.get(Store);
      dispatcher = injector.get(Dispatcher);
    });
开发者ID:cartant,项目名称:store,代码行数:9,代码来源:edge.spec.ts

示例9: rawApiCall

    /**
     * Gets Angular2Apollo service and calls a method
     *
     * Checks if method with the same name has been called
     * with the same same options
     *
     * It also checks if service method returns result of ApolloClient method
     *
     * @param  {string} method  Name of method you want to test
     * @param  {any} options    Used options
     * @param  {any} result     Mock result
     */
    function rawApiCall(method: string, options = 'options', result = 'result') {
      spyOn(client, method).and.returnValue(result);

      const injector = ReflectiveInjector.resolveAndCreate([defaultApolloClient(client), APOLLO_PROVIDERS]);
      const service = injector.get(Angular2Apollo);

      expect(service[method](options)).toBe(result);
      expect(client[method]).toHaveBeenCalledWith(options);
    }
开发者ID:gaslight,项目名称:angular2-apollo,代码行数:21,代码来源:angular2Apollo.ts

示例10: it

    it('should work mockWrapper with fakeDI', () => {
        let injector = ReflectiveInjector.resolveAndCreate([
            MockWrapperService,
            provide(TestService, { useClass: MockTestService })]);

        let service = injector.get(MockWrapperService);
        expect(service.getService()).toContain({ fname: 'vasya', lname: 'pupkin' });

    });
开发者ID:kolanton,项目名称:nanaDev,代码行数:9,代码来源:nanaservice.service.test.ts


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