Assuming that the items get added to news
array. What you need to do is watch on the news
array and see when it gets filled and then apply your ticker.
Your current directive definition does not create a new scope so the news
array would be accessible so yo can do something like
link: function($scope, iElm, iAttrs, controller) {
$scope.$watch("news", function(newValue,oldValue) {
if(newValue && newValue.length > 0) {
$timeout(function () {
// console.log($(iElm).html());
$(iElm).vTicker($scope.$eval(iAttrs.vTicker));
}, 0);
}
}
}
}
Now if you reassign your news
array this watch would fire. You can pass the news
array using isolated scope too.