refactor(compiler): don’t rely on global reflector (#16832)

Using the global reflector made it impossible
to compile multiple programs at the same time.
This commit is contained in:
Tobias Bosch
2017-05-18 13:46:51 -07:00
committed by Chuck Jazdzewski
parent de8d7c65f2
commit 50abca4583
52 changed files with 333 additions and 338 deletions

View File

@ -6,11 +6,14 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Component, Directive, HostBinding, HostListener, Input, Output, Query, Type, resolveForwardRef, ɵReflectorReader, ɵreflector, ɵstringify as stringify} from '@angular/core';
import {Component, Directive, HostBinding, HostListener, Input, Output, Query, Type, resolveForwardRef, ɵstringify as stringify} from '@angular/core';
import {CompileReflector} from './compile_reflector';
import {CompilerInjectable} from './injectable';
import {splitAtColon} from './util';
/*
* Resolve a `Type` for {@link Directive}.
*
@ -20,7 +23,7 @@ import {splitAtColon} from './util';
*/
@CompilerInjectable()
export class DirectiveResolver {
constructor(private _reflector: ɵReflectorReader = ɵreflector) {}
constructor(private _reflector: CompileReflector) {}
isDirective(type: Type<any>) {
const typeMetadata = this._reflector.annotations(resolveForwardRef(type));