I have the following service in my app:
uaInProgressApp.factory(\'uaProgressService\',
function(uaApiInterface, $timeout, $rootScope){
var facto
No $watch
or etc. is required. You can simply define the following
uaInProgressApp.controller('ua.InProgressController',
function ($scope, $rootScope, $routeParams, uaContext, uaProgressService) {
uaContext.getSession().then(function(){
uaContext.appName.set('Testing house');
uaContext.subAppName.set('In progress');
uaProgressService.startCron();
});
$scope.getTaskList = function() {
return uaProgressService.taskList;
};
});
Because the function getTaskList
belongs to $scope
its return value will be evaluated (and updated) on every change of uaProgressService.taskList