And what's the solution to avoid this situation, please? Would you opt by adding a setter to the property?
It depends what do you want to achieve with this function. Like I read this it should only take the email into account if the name is empty so something like this:
ngOnChanges({ name, email }: SimpleChanges) { const username = name?.currentValue ?? this.name ?? email?currentValue ?? this.email this.username$.next(username); }
Thanks for replying asap! Best regards.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
And what's the solution to avoid this situation, please? Would you opt by adding a setter to the property?
It depends what do you want to achieve with this function.
Like I read this it should only take the email into account if the name is empty so something like this:
Thanks for replying asap! Best regards.