How to get the parent DOM element reference of an angular2 component

前端 未结 5 1895
醉酒成梦
醉酒成梦 2021-01-04 20:32

I need to access to some properties of the parent DOM element which contains the component from where i want to get the info, is there a way to do such thing?

Here i

5条回答
  •  感动是毒
    2021-01-04 21:20

    The child component shouldn't update properties on the parent. Instead have the child emit events and the parent change the properties. The docs have an example in the Component Interaction section.

提交回复
热议问题