How can I define a Touchend or complete a change in a range value?

I am using AngularJS with the Ionic Framework. I am developing a real-time communication application.

I have a slider for the range of an ionic document . If I use ng-change, each step calls my callback, but I only want to pass the final result. On the desktop, I can use ng-mouseup, but I can not find a solution on mobile devices. Creating a delay is not a solution for me, because it has to be fast.

+6
source share
1 answer

You can try using the release event directive provided by Ionic. The example below is not tested, but should give you an idea.

http://ionicframework.com/docs/api/directive/onRelease/

Markup

<div class="range"> <i class="icon ion-volume-low"></i> <input type="range" name="volume" ng-model="temp.volume" on-release="onRelease()"> <i class="icon ion-volume-high"></i> </div> 

controller

 angular.module('App').controller(function ($scope) { $scope.onRelease = function () { $scope.volume = $scope.temp.volume; }; }); 
+8
source

Source: https://habr.com/ru/post/977777/


All Articles