Angular 2 child component refers to parent component -
i have application contains 3 components. application, editview,dialog.
application components contains editview components can contain many other editview components , 1 dialog component( if dialog component visible on page).
dialog component contains application component. when put in dialog component in declaration path:
directives:[application]
i'am getting error:
unexpected directive value 'undefined' on view of component 'dialog'
is possible @ have such structure child component can contain component upper level regarding conditions?
if drop application component dialog or replace other components works fine.
zlaja
putting in directives list won't work, can still have access parent component having injected in constructor of child directive:
constructor(@host(application) application: application) { }
and parent component can live list of child components using @query
:
constructor(@query(editview) editviews: querylist<editview>){ }
Comments
Post a Comment