You can either use a directive (which is more the AngularJS way), or since you have to include jQuery for uiKit, you could just use jQuery, as in your question.
Either way you'll need to wrap in a $scope.apply() function if you want to update scope properties.
Directive version:
var app = angular.module('App', []);
app.controller('AppCtrl', function($scope) {
$scope.movedItemDirectiveVersion = "No item has been moved yet...";
});
app.directive("mySortable", function() {
return {
restrict: 'A',
link: function(scope, elem, attrs) {
elem.on('change.uk.sortable.mySortable', function(event, sortableObj, element, action) {
scope.$apply(function() {
scope.movedItemDirectiveVersion = "You moved " + element[0].innerText;
});
});
// clean up when scope is destroyed
scope.$on("$destroy",
function() {
elem.off("change.uk.sortable.mySortable");
}
);
}
}
});
<ul class="uk-sortable uk-grid uk-grid-small uk-grid-width-1-5" data-uk-sortable="" my-sortable>
<li class="uk-grid-margin" style="">
<div class="uk-panel uk-panel-box">Item 1</div>
</li>
<li class="uk-grid-margin" style="">
<div class="uk-panel uk-panel-box">Item 2</div>
</li>
</ul>
Non-directive version:
var app = angular.module('App', []);
app.controller('AppCtrl', function($scope) {
$scope.movedItem = "No item has been moved yet...";
$('#withoutDirective').on("change.uk.sortable", function(event, sortableObj, element, action) {
$scope.$apply(function() {
$scope.movedItem = "You moved " + element[0].innerText;
});
});
});
<ul id="withoutDirective" class="uk-sortable uk-grid uk-grid-small uk-grid-width-1-5" data-uk-sortable="">
<li class="uk-grid-margin" style="">
<div class="uk-panel uk-panel-box">Item 1</div>
</li>
<li class="uk-grid-margin" style="">
<div class="uk-panel uk-panel-box">Item 2</div>
</li>
</ul>
Demo for both versions: http://jsfiddle.net/s9fr43of/1/
document.getElementById('sample').addEventListener('change.uk.sortable', function() {...})