本文整理汇总了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)}`);
}
示例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)}`);
}
示例3: directive
get directive() { return resolveForwardRef(this._directive); }
示例4: selector
get selector() { return resolveForwardRef(this._selector); }
示例5: it
it('should wrap and unwrap the reference', () => {
var ref = forwardRef(() => String);
expect(ref instanceof Type).toBe(true);
expect(resolveForwardRef(ref)).toBe(String);
});