Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit acf38b3

Browse files
committed
docs(CHANGELOG.md): add missing breaking change from 1.3.0-beta.14
Closes #8474
1 parent 9475328 commit acf38b3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

CHANGELOG.md

+30
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,36 @@ Closes #3969
622622
Closes #4277
623623
Closes #7960
624624

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+
625655
<a name="1.2.19"></a>
626656
# 1.2.19 precognitive-flashbacks (2014-06-30)
627657

0 commit comments

Comments
 (0)