@Input() UpItem: Item ;
On catching something in UpItem I want to execute a function when some property is passed from parent to child.
@Input() UpItem: Item ;
On catching something in UpItem I want to execute a function when some property is passed from parent to child.
Using a getter/setter is probably the best way
private _upItem:Item
@Input() set UpItem(value:Item) {
this._upItem = value;
this.doSomething();
}
get UpItem():Item {
return this._upItem;
}
ngOnInit
might be more convenient if you want to call the same code when one or more of several different inputs change