本文整理汇总了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;未经允许,请勿转载。 |
请发表评论