Reputation: 131
I have problem with zeros like above :
in html I have :
<div class="form-group form-group-default">
<label>Numéro</label>
<input class="form-control" style="margin-bottom: 11px;" placeholder="(+33)57 24 05 99" ng-model="produit.telephone">
</div>
the model is:
telephone: {type: Number, default: null}
when I put a number which has zero on the left, it will not be considered.
for instance when I put 0160206576, it will be saved as 160206576
Upvotes: 1
Views: 167
Reputation: 3820
Change the type number
, for allowing preloading 0
, to String
telephone: {type: String, default: null}
Upvotes: 0
Reputation: 657
If it has zeros in the front, it must be stored as a string, like this:
app.controller("main",function($scope){
$scope.produit.telephone = "0160206576";
});
Upvotes: 3