I have the below code :
variable declaration :
$scope.updateUploadView =
{
ready:{
inview:false,
text: "starting"
},
uploading:{
inview:false,
text: "uploading"
},
done:{
inview:false,
text: "done !"
}
};
$watch :
angular.forEach($scope.updateUploadView, function(element, key) {
$scope.$watch(function () {
return element;
}, function() {
// do stuff
});
},true);
});
The problem here is that i want to ignore $watch to trigger on the undefined property because it cause the view to change 3 times on the start of the application. Is there any possibility to wait the variable declaration ?