refactor(compiler): never create CompileDirectiveMetadata with not loaded resources (#12788)

Part of #12787
This commit is contained in:
Tobias Bosch
2016-11-10 14:07:30 -08:00
committed by Victor Berchet
parent c3c0e2e2a2
commit 79383ce150
14 changed files with 1165 additions and 935 deletions

View File

@ -26,6 +26,11 @@ function _isPipeMetadata(type: any): boolean {
export class PipeResolver {
constructor(private _reflector: ReflectorReader = reflector) {}
isPipe(type: Type<any>) {
const typeMetadata = this._reflector.annotations(resolveForwardRef(type));
return typeMetadata && typeMetadata.some(_isPipeMetadata);
}
/**
* Return {@link Pipe} for a given `Type`.
*/