how to use parent module component in child module component in angular2

后端 未结 2 1925
攒了一身酷
攒了一身酷 2021-02-12 11:38

I have header that should be used in both child and parent module.that was imported and used in parent module but when try to import and using in child component it showing erro

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-12 11:50

    It would have been great , if you can share the code and the specified the error you are getting.

    As per my understanding , you basically want to pass some data from parent component to its child component .

    For this , you need to use @Input to pass parent params to child.

    Component Interaction between parent and child

    Let me know , if it helps or not

提交回复
热议问题