Input field is not loading default value "value"

0

I have the field:

<div class="form-group">
 <label style="color:white" for="valor">Valor</label>
   <div class="input-group">
      <input type="number" value = "0" class="form-control" step="any" name="valor" ng-model="contato.valor" required>

...

However, the field is not initializing with the value defined in the value.

Can anyone help me?

    
asked by anonymous 30.08.2017 / 21:51

1 answer

0

This happens because you have a ng-model . The value of this input is ng-model, you are probably not passing anything to this model, so it goes empty.

Go to your controller and enter a value for this Model, in your case, you want the value to be equal to 0.

Then go to your controller and put:

$scope.contato.valor = 0

Read more about Ng-Model here

    
18.09.2017 / 22:20