Answer the question
In order to leave comments, you need to log in
How to receive only new incoming data in a child component?
There are parent and child components. The parent has two buttons and a variable. When the first button is clicked, the value "4" is assigned to the variable. When another button is clicked, the variable is assigned the value "2" The
child component gets this value of this variable through an attribute like so:
<hello [isVisibleDatepicker]="isVisibleDatepicker"></hello>
ngAfterViewChecked() {
console.log('--------', this.isVisibleDatepicker);
}
Answer the question
In order to leave comments, you need to log in
That is, if the user clicked three times on the first button, then the child component displayed the value "4" only once.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question