How can I set ranges in Ionic with a predetermined initial value?

Asked

Viewed 68 times

0

I put in a Range to set the time and minutes. As I show in the view, but despite setting the "value" in the system the range always starts in the middle and worthless.

How can I set my ranges to be there at the beginning, with the value I want?

     <div class="item range">
                        Horas
                        <input type="range" min="0" max="24" value="1" step="1" ng-model="configura.hora_prazo_min">
                        <i class="icon ion-clock"></i>
                    </div>

                    <p><b>Horas: </b>{{configura.hora_prazo_min}}</p>



                    <div class="item range">
                        Minutos
                        <input type="range" min="0" max="60" value="0" step="1" ng-model="configura.minutos_prazo_min" >
                        <i class="icon ion-clock"></i>
                    </div>

                    <b>Minutos:  </b>{{configura.minutos_prazo_min}}   
</div>    

1 answer

0


It was actually lack of attention from me. I had to have created the models after the array:

$scope.configura = [];

        $scope.configura.hora_prazo_min = 0;
        $scope.configura.minutos_prazo_min = 0;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.