i have a list of items and i want when i move my finger over them i get the
id for example of each item. it work with mouse but not with touch.
(this is a test project) and here is the lib i'm
using https://github.com/nglar/ngTouch#ng-touchmove
in html :
<p class="text-center" > item : {{current}}</p>
<p class="text-center" > state : {{state}}</p>
<div class="row" ng-repeat="item in items" >
<div ng-style="{background: color}"
style="width:100px;height:100px;margin-top:10px;margin-left:auto;margin-right:auto"
ng-touchstart="onTouchstart(item)"
ng-touchmove="onTouchmove(item)"
ng-touchend="onTouchend(item)"
><p>{{item}}</p>
</div>
</div>
my js code :
$scope.items = ["1" , "2" , "3"];
$scope.current = "0";
$scope.state = "waiting..."
$scope.color = "red";
$scope.onTouchstart = function(item) {
$scope.current = item;
$scope.state = "Touch start"
}
$scope.onTouchmove = function(item) {
$scope.current = item;
$scope.state = "Touch move"
}
$scope.onTouchend = function(item) {
$scope.current = item;
$scope.state = "Touch end"
}
the events are working but for example i touched item 1 and started draging
to item 2 it doesn't detect it it still on item one.
did someone have an idea how to make it work :) thx
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.