@@ -216,38 +216,41 @@ export class DirectiveBinding extends ResolvedBinding {
216216
217217 get changeDetection ( ) { return this . metadata . changeDetection ; }
218218
219- static createFromBinding ( binding : Binding , ann : DirectiveMetadata ) : DirectiveBinding {
220- if ( isBlank ( ann ) ) {
221- ann = new DirectiveMetadata ( ) ;
219+ static createFromBinding ( binding : Binding , meta : DirectiveMetadata ) : DirectiveBinding {
220+ if ( isBlank ( meta ) ) {
221+ meta = new DirectiveMetadata ( ) ;
222222 }
223223
224224 var rb = binding . resolve ( ) ;
225225 var deps = ListWrapper . map ( rb . dependencies , DirectiveDependency . createFrom ) ;
226- var resolvedBindings = isPresent ( ann . bindings ) ? Injector . resolve ( ann . bindings ) : [ ] ;
227- var resolvedViewBindings = ann instanceof ComponentMetadata && isPresent ( ann . viewBindings ) ?
228- Injector . resolve ( ann . viewBindings ) :
226+ var resolvedBindings = isPresent ( meta . bindings ) ? Injector . resolve ( meta . bindings ) : [ ] ;
227+ var resolvedViewBindings = meta instanceof ComponentMetadata && isPresent ( meta . viewBindings ) ?
228+ Injector . resolve ( meta . viewBindings ) :
229229 [ ] ;
230230 var metadata = RenderDirectiveMetadata . create ( {
231231 id : stringify ( rb . key . token ) ,
232- type : ann instanceof ComponentMetadata ? RenderDirectiveMetadata . COMPONENT_TYPE :
233- RenderDirectiveMetadata . DIRECTIVE_TYPE ,
234- selector : ann . selector ,
235- compileChildren : ann . compileChildren ,
236- events : ann . events ,
237- host : isPresent ( ann . host ) ? MapWrapper . createFromStringMap ( ann . host ) : null ,
238- properties : ann . properties ,
232+ type : meta instanceof ComponentMetadata ? RenderDirectiveMetadata . COMPONENT_TYPE :
233+ RenderDirectiveMetadata . DIRECTIVE_TYPE ,
234+ selector : meta . selector ,
235+ compileChildren : meta . compileChildren ,
236+ events : meta . events ,
237+ host : isPresent ( meta . host ) ? MapWrapper . createFromStringMap ( meta . host ) : null ,
238+ properties : meta . properties ,
239239 readAttributes : DirectiveBinding . _readAttributes ( deps ) ,
240240
241- callOnDestroy : hasLifecycleHook ( LifecycleEvent . OnDestroy , rb . key . token , ann ) ,
242- callOnChanges : hasLifecycleHook ( LifecycleEvent . OnChanges , rb . key . token , ann ) ,
243- callDoCheck : hasLifecycleHook ( LifecycleEvent . DoCheck , rb . key . token , ann ) ,
244- callOnInit : hasLifecycleHook ( LifecycleEvent . OnInit , rb . key . token , ann ) ,
241+ callOnDestroy : hasLifecycleHook ( LifecycleEvent . OnDestroy , rb . key . token , meta ) ,
242+ callOnChanges : hasLifecycleHook ( LifecycleEvent . OnChanges , rb . key . token , meta ) ,
243+ callDoCheck : hasLifecycleHook ( LifecycleEvent . DoCheck , rb . key . token , meta ) ,
244+ callOnInit : hasLifecycleHook ( LifecycleEvent . OnInit , rb . key . token , meta ) ,
245+ callAfterContentInit : hasLifecycleHook ( LifecycleEvent . AfterContentInit , rb . key . token , meta ) ,
245246 callAfterContentChecked :
246- hasLifecycleHook ( LifecycleEvent . AfterContentChecked , rb . key . token , ann ) ,
247+ hasLifecycleHook ( LifecycleEvent . AfterContentChecked , rb . key . token , meta ) ,
248+ callAfterViewInit : hasLifecycleHook ( LifecycleEvent . AfterViewInit , rb . key . token , meta ) ,
249+ callAfterViewChecked : hasLifecycleHook ( LifecycleEvent . AfterViewChecked , rb . key . token , meta ) ,
247250
248- changeDetection : ann instanceof ComponentMetadata ? ann . changeDetection : null ,
251+ changeDetection : meta instanceof ComponentMetadata ? meta . changeDetection : null ,
249252
250- exportAs : ann . exportAs
253+ exportAs : meta . exportAs
251254 } ) ;
252255 return new DirectiveBinding ( rb . key , rb . factory , deps , resolvedBindings , resolvedViewBindings ,
253256 metadata ) ;
0 commit comments