I have a date field and I want to remove the place holder by default.
I am using javascript onfocus and onfocusout events for removing pl
Try to use (focus) and (focusout) instead of onfocus and onfocusout
like this : -
also you can use like this :-
some people prefer the on- prefix alternative, known as the canonical form:
Know more about event binding see here.
you have to use HostListner for your use case
Angular will invoke the decorated method when the host element emits the specified event.
@HostListeneris a decorator for the callback/event handler method
See my Update working Plunker.
Working Example Working Stackblitz
Some other events can be used in angular -
(focus)="myMethod()"
(blur)="myMethod()"
(submit)="myMethod()"
(scroll)="myMethod()"