本文整理汇总了TypeScript中@angular/core.resolveForwardRef函数的典型用法代码示例。如果您正苦于以下问题:TypeScript resolveForwardRef函数的具体用法?TypeScript resolveForwardRef怎么用?TypeScript resolveForwardRef使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resolveForwardRef函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: resolve
/**
* Return {@link PipeMetadata} for a given `Type`.
*/
resolve(type: Type): PipeMetadata {
var metas = this._reflector.annotations(resolveForwardRef(type));
if (isPresent(metas)) {
var annotation = metas.find(_isPipeMetadata);
if (isPresent(annotation)) {
return annotation;
}
}
throw new BaseException(`No Pipe decorator found on ${stringify(type)}`);
}
示例2: resolve
/**
* Return {@link Pipe} for a given `Type`.
*/
resolve(type: Type<any>, throwIfNotFound = true): Pipe|null {
const metas = this._reflector.annotations(resolveForwardRef(type));
if (metas) {
const annotation = findLast(metas, _isPipeMetadata);
if (annotation) {
return annotation;
}
}
if (throwIfNotFound) {
throw new Error(`No Pipe decorator found on ${stringify(type)}`);
}
return null;
}
示例3: resolve
resolve(type: Type<any>, throwIfNotFound = true): Directive|null {
const typeMetadata = this._reflector.annotations(resolveForwardRef(type));
if (typeMetadata) {
const metadata = findLast(typeMetadata, isDirectiveMetadata);
if (metadata) {
const propertyMetadata = this._reflector.propMetadata(type);
return this._mergeWithPropertyMetadata(metadata, propertyMetadata, type);
}
}
if (throwIfNotFound) {
throw new Error(`No Directive annotation found on ${stringify(type)}`);
}
return null;
}
示例4: isPipe
isPipe(type: Type<any>) {
const typeMetadata = this._reflector.annotations(resolveForwardRef(type));
return typeMetadata && typeMetadata.some(_isPipeMetadata);
}