當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。