i'm trying to do sorting list, i take the element from the db but..
Error: cannot call methods on sortable prior to initialization; attempted to call method 'refresh'
my html:
<div class="box-body" >
<div ng:controller="menuConfigCtrl">
<ul ui-sortable ng-model="menu" >
<li ng:repeat="item in menu |filter:'all' | orderBy:'order':false" >{{item.Title}}</li>
</ul>
</div>
</div>
and my controller:
function menuConfigCtrl($location,$scope, menuFactory) {
$scope.menu = [];
menuFactory.getMenu().success(function(data){
$scope.menu = data;
});
}
my getMenu() is:
getMenu : function(){
return $http({
url: '/api/menuList',
method: 'GET',
});
},
if i get the menu not from a rest service, but binding it, everyting work without error! what can be?
solved. i imported 2 times angularjs.js :P
$scope.$apply();
after$scope.menu = data;
– Asok Jun 27 at 17:56