Mask for an Input to allow phone numbers?
Angular5 and 6: angular 5 and 6 recommended way is to use @HostBindings and @HostListeners instead of the host property remove host and add @HostListener Working Online stackblitz Link: https://angular6-phone-mask.stackblitz.io Stackblitz Code example: https://stackblitz.com/edit/angular6-phone-mask Official documentation link https://angular.io/guide/attribute-directives#respond-to-user-initiated-events Angular2 and 4: Plunker >= RC.5 original One way you could do it is using a directive that injects NgControl and manipulates the … Read more