if (drakeObj) {
drakeObj.destroy();
setTimeout(function() {
drakeObj = dragularService('.container-vertical', {
scope: $scope,
revertOnSpill: true,
removeOnSpill: false,
nameSpace: 'sponsorranks',
containersModel: $scope.rankedSponsors,
moves: function(el, container, handle) {
if(handle.classList.contains('drag-nd-img')){
return handle.className === 'drag-img drag-nd-img';
} else {
return false;
}
},
invalid: function(el, handle){
if(handle.classList.contains('drag-nd-img')){
return false;
} else {
return true;
}
}
});
}, 500);
}
$scope.$on('dragulardrop', function(e, el, container) {
$scope.updateuserRanks($scope.rankedusers);
});
<div class="search pull-right">
<input type="text" value="search" class="search-box" data-ng-model="searchuser" placeholder="Search" ng-model-options='{ debounce: 700 }' /><span class="fa fa-search search-icon"></span>
</div>
<div class="rank-users-list container-vertical">
<div class="rank" ng-repeat="user in rankedusers | filter: searchuser">
<div class="rank-num">
<div class="inputbox">
{{user.rank}}
</div>
</div>
</div>
</div>
我正在尝试搜索 ng-repeat 列表值,搜索后我正在拖动列表,但更新后列表相同,不会更改 dragularService 中的用户等级。您能否为此提出一些解决方案。