HTML page:
<div class="myClass">
<h2>Test</h2>
<sort users="users" id="test"><sort>
</div>
AngularJS Directive:
angular.module('myModule').directive('sort', function() {
return {
scope: {
users: '='
},
template: '<ul><li ng-repeat="item in users"><h3>{{item.name}}</h3></li></ul>',
link: function (scope, element) {
scope.$watch('users', function(newValue, oldValue){
if (newValue!== oldValue) {
}
}, true);
$(element).sortable({
connectWith: "ul",
items: 'li',
start: function(event, ui) {
},
stop: function(event, ui) {
$(element).sortable('refresh');
scope.$applyAsync();
}
});
}
}
});
And question is how to refresh (jQueryUI) my tab and angular can see this changes without using UI.Sortable ? Because in my way AngularJS doesn't see any changes in tab.