angularjs - angularfire & ui.sortable : passing ng-repeat value into sortableOptions -
i have basic ng-repeat task sortable
<div ng-sortable="sortableoptions"> <div ng-repeat="task in todo"> {{task}} ...
when task draged , droped, calls $scope.sortableoptions in controller. i'm wondering if knows how pass task object that? set function or..
basically, want pass task in , update 1 of properties inherent todo.
$scope.sortableoptions2 = { stop: function(event, ui) { // specific todo here }); }
thank u
if using ng-sortable yeah can ,
<ul data-as-sortable="sortableoptions" data-ng-model="todo"> <li data-ng-repeat="item in todo" data-as-sortable-item> <div data-as-sortable-item-handle></div> </li> </ul>
and in controller ,
$scope.sortableoptions = { accept: function (sourceitemhandlescope, destsortablescope) {return boolean}//override determine drag allowed or not. default true. itemmoved: function (event) {//do want}, orderchanged: function(event) {//do want}, containment: '#board'//optional param. };
Comments
Post a Comment