How to observe input element changes in ng-content

后端 未结 5 1640
[愿得一人]
[愿得一人] 2021-01-17 18:03

How to call parent component\'s function when child component observed input changes?

The below is HTML structure.

# app.comopnent.html
5条回答
  •  我在风中等你
    2021-01-17 18:26

    You can use Angular CDK observers https://material.angular.io/cdk/observers/api

    import this module in your module

    import { ObserversModule } from '@angular/cdk/observers';
    

    then use in ng-content's parent element

提交回复
热议问题