I have a component with an input and a variable:
@Input() data: string[];
@Input() val: string = '';
ngOnChanges(changes: SimpleChanges) {
for (let propName in changes) {
if (propName == 'data') {
this.val = 'hello';
}
}
}
The problem is, i need to change the input val when data is changed. But i have the following error:
Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'.
Thanks !