Then the ngOnChanges will be called first with only email and then with only username so one of the two is undefined. Only the values that are changed are submitted in the SimpleChanges
We're a place where coders share, stay up-to-date and grow their careers.
Hi! do you mean that name or email could be undefined? TBH I'd never ship this to production - just needed a short example with multiple inputs 😅
Ok so if you have a component that uses your code like this
If the input of the observables look like this
Then the ngOnChanges will be called first with only
email
and then with onlyusername
so one of the two is undefined. Only the values that are changed are submitted in theSimpleChanges