Custom input formatting with simple directives for Angular 2
Tomas Trajan

Hi, I was following your article in using the directive with an input element:

<input type=”text” [ngModel]=”amount” (ngModelChange)=”onAmountChange($event)” myCurrencyFormatter />

However it doesn’t seem on work on my code. When the ngOnInit method of the directive is called, the value of this.el is still blank. I was wondering how you could fix this?


Like what you read? Give Franco Lee a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.