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?
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.
$digest
$scope.my
1
1.4m articles
1.4m replys
5 comments
57.0k users