本文整理匯總了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);
});