app.factory('YouService', function() {
var progress = 90;
getProgress: function() {
return progress;
}
});
app.directive('YouDirective', function(YouService) {
return {
restrict: 'E',
...
...
link: function(scope, element, attrs) {
scope.$watch(function () {
return YouService.getProgress();
}, function (progress) {
console.log(progress);
}
});
}
});