This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -622,6 +622,36 @@ Closes #3969
622
622
Closes #4277
623
623
Closes #7960
624
624
625
+ - ** $timeout/$interval:**
626
+ - due to [ 19b6b343] ( https://github.com/angular/angular.js/commit/19b6b3433ae9f8523cbc72ae97dbcf0c06960148 )
627
+
628
+
629
+ Previously, even if invokeApply was set to false, a $rootScope digest would occur during promise
630
+ resolution. This is no longer the case, as promises returned from $timeout and $interval will no
631
+ longer trigger $evalAsync (which in turn causes a $digest) if ` invokeApply ` is false.
632
+
633
+ Workarounds include manually triggering $scope.$apply(), or returning $q.defer().promise from a
634
+ promise callback, and resolving or rejecting it when appropriate.
635
+
636
+ var interval = $interval(function() {
637
+ if (someRequirementFulfilled) {
638
+ $interval.cancel(interval);
639
+ $scope.$apply();
640
+ }
641
+ }, 100, 0, false);
642
+
643
+ or:
644
+
645
+ var interval = $interval(function (idx) {
646
+ // make the magic happen
647
+ }, 1000, 10, false);
648
+ interval.then(function(idx) {
649
+ var deferred = $q.defer();
650
+ // do the asynchronous magic --- $evalAsync will cause a digest and cause
651
+ // bindings to update.
652
+ return deferred.promise;
653
+ });
654
+
625
655
<a name =" 1.2.19 " ></a >
626
656
# 1.2.19 precognitive-flashbacks (2014-06-30)
627
657
You can’t perform that action at this time.
0 commit comments