Reputation: 32726
In a few script I can find for instance
$timeout(function () {
$scope.my = 1;
});
instead of simply
$scope.my = 1;
What's the purpose to call $timeout without delay?
Upvotes: 33
Views: 8760
Reputation: 67296
This is a hack. :) But usually the intention is to wait until the end of the $digest
cycle and then set $scope.my
to 1
. Timeouts are called after all watches are done.
Upvotes: 54