In Angular6, i am getting a variable value to client from Parent using @Input()
@Input() orderdata: OrderData;
and binded to a field using [ngModel] and (ngModelChange) function.
In the child component when user changes this variable value (binded) I need to do a validation comparing the new value and old value. How to do this?
I tried assigning orderdata to a new variable
oldorderdata = orderdata;
and then later perform the comparison. But when ever user changes the orderdata at the moment itself oldorderdata is also changed.
OnChanges?