I would personally use ngOnChanges
as a solution. With the set input function, you would need to create a variable like #_username
and validate whether the variable has actually changed or not. Otherwise, you could end up in a loop or trigger the ExpressionChangedAfterItHasBeenChecked error. But I wonder, couldn't the parent component update its signal? This way, you would avoid having an input 'username' in your component and instead receive the signal directly in a computed property, making your component more independent and clean.