I have 2 components. component A and component B. In component A has an output that when emit set an input in component B when this happens I get this error:
expression has been changed after it was checked.
The components are shown below:
<app-cmp-A (onSelect)="selectedData = $event"></app-cmp-A>
<app-cmp-B [selectedItem]="selectedData"></app-cmp-B>
My question is that why this error happen and this scenario is very useful when we use cascading component that one component require output another?