Solved it... Added a watch in the directive - that watch a variable that changes when the data recieives from the server - and the accordion is activated!
angular.module('accordion', [])
.directive('accordion', function () {
return {
restrict: 'AE',
replace: true,
link: function (scope, element, attrs) {
scope.$watch('serverData', function (newValue, oldValue) {
if (oldValue != newValue) {
element.accordion();
}
});
}
};
});