3
3
Component , ComponentFactoryResolver , ViewContainerRef , Input , ComponentRef , Type ,
4
4
ReflectiveInjector , ViewChild , Injector , Inject
5
5
} from '@angular/core' ;
6
+ import { ReflectorReader , reflector } from '../private_import_core' ;
6
7
7
8
import { UIRouter } from "../../router" ;
8
9
import { trace } from "../../common/trace" ;
@@ -26,12 +27,10 @@ interface InputMapping {
26
27
prop : string ;
27
28
}
28
29
29
- declare var Reflect : any ;
30
-
31
30
/** @hidden */
32
31
const ng2ComponentInputs = ( ng2CompClass : Type < any > ) => {
33
32
/** Get "@Input('foo') _foo" inputs */
34
- let props = Reflect [ 'getMetadata' ] ( ' propMetadata' , ng2CompClass ) ;
33
+ let props = reflector . propMetadata ( ng2CompClass ) ;
35
34
let _props = Object . keys ( props || { } )
36
35
// -> [ { key: string, anno: annotations[] } ] tuples
37
36
. map ( key => ( { key, annoArr : props [ key ] } ) )
@@ -43,7 +42,7 @@ const ng2ComponentInputs = (ng2CompClass: Type<any>) => {
43
42
. map ( tuple => ( { token : tuple . anno . bindingPropertyName || tuple . key , prop : tuple . key } ) ) ;
44
43
45
44
/** Get "inputs: ['foo']" inputs */
46
- let inputs = Reflect [ 'getMetadata' ] ( ' annotations' , ng2CompClass )
45
+ let inputs = reflector . annotations ( ng2CompClass )
47
46
// Find the ComponentMetadata class annotation
48
47
. filter ( x => x instanceof Component && ! ! x . inputs )
49
48
// Get the .inputs string array
0 commit comments