I have typical setter/getter for an input in my code, as I want to execute a function when the value changes, but somehow it is fired without input changes
private _myInput: string[]: [];
@Input()
get myInput(): string[] {
return this._myInput;
}
set myInput(myInput[]) {
this._myInput = myInput;
this.doStuff();
}
the problem doStuff method is called too many times because i receive an empty list in a constant way. I only want the setter get fired when there is changes