$scope.$watch(function(){return self.user}, function (newVal, oldVal, scope){
if (self.user) {
getNotificationCount();
}
});
var getNotificationCount = function(){
console.log("called your function");
}
, getNotificationCount, . , , $scope. $Watch code block , , getNotificationCount.
getNotificationCount ,
function getNotificationCount() {
console.log('calling your function')
}
. , .
, , $scope. $watch().
, , , , $scope. $Watch, getNotificationCount .
, var getNotificationCount, $scope. $watch ( , )