I have an input field of type number. When the user enter multiple zeros (0s) and moves to the next input field, the multiple zeros should go back to single 0.
I have tried the following code in the plunkr: https://plnkr.co/edit/dyCp5ZMKOkZvcsw4F8og?p=preview
<input [(ngModel)]="value" type="number" class="form-control" id="valueId"
(ngModelChange)="valuechange($event)">
valuechange(newValue) {
//newValue = newValue.toString().replace(/^0+/, '0');
newValue=parseInt(newValue.toString());
console.log(newValue);
}