I've got an input field that I have attached a directive to.
<input type="email"
id="email"
formControlName="email"
email
[placeholder]>
The directive is placeholder, when a user updates the input with a new value I want to run some code in the directive:
@Input() public input: String;
constructor(private el: ElementRef) {}
@HostListener('change') ngOnChanges() {
console.log('test');
}
I thought I'd need to use the hostListener directive to check for a change but this isn't working as I intended. My intention is to add a class when the input has a value inside of it.
What do others do to achieve this?