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


TypeScript di.resolveForwardRef函數代碼示例

本文整理匯總了TypeScript中angular2/di.resolveForwardRef函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript resolveForwardRef函數的具體用法?TypeScript resolveForwardRef怎麽用?TypeScript resolveForwardRef使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: resolve

 /**
  * Return {@link DirectiveMetadata} for a given `Type`.
  */
 resolve(type: Type): DirectiveMetadata {
   var annotations = reflector.annotations(resolveForwardRef(type));
   if (isPresent(annotations)) {
     for (var i = 0; i < annotations.length; i++) {
       var annotation = annotations[i];
       if (annotation instanceof DirectiveMetadata) {
         return annotation;
       }
     }
   }
   throw new BaseException(`No Directive annotation found on ${stringify(type)}`);
 }
開發者ID:KenWilliamson,項目名稱:Angular2HostedMobileApp,代碼行數:15,代碼來源:directive_resolver.ts

示例2: resolve

 /**
  * Return {@link Pipe} for a given `Type`.
  */
 resolve(type: Type): Pipe {
   var metas = reflector.annotations(resolveForwardRef(type));
   if (isPresent(metas)) {
     for (var i = 0; i < metas.length; i++) {
       var annotation = metas[i];
       if (annotation instanceof Pipe) {
         return annotation;
       }
     }
   }
   throw new BaseException(`No Pipe decorator found on ${stringify(type)}`);
 }
開發者ID:goderbauer,項目名稱:angular,代碼行數:15,代碼來源:pipe_resolver.ts

示例3: directive

 get directive() { return resolveForwardRef(this._directive); }
開發者ID:B-Thapa,項目名稱:angular,代碼行數:1,代碼來源:di.ts

示例4: selector

 get selector() { return resolveForwardRef(this._selector); }
開發者ID:cedriclam,項目名稱:angular,代碼行數:1,代碼來源:di.ts

示例5: it

 it('should wrap and unwrap the reference', () => {
   var ref = forwardRef(() => String);
   expect(ref instanceof Type).toBe(true);
   expect(resolveForwardRef(ref)).toBe(String);
 });
開發者ID:188799958,項目名稱:angular,代碼行數:5,代碼來源:forward_ref_spec.ts


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