I have the following code:
function myFunction(elem){
console.log(elem);
}
scope.$watch(function(){
return obj.width;
}, function(valTo, valFrom) {
myFunction(valTo);
});
But I have question on doing something like this. The myFunction
function is running once the watcher triggers an event. But if the watcher triggers multiple events, does it maintain the function running on all those events or does it stop everything on every previous events once the new event kicks in?