|
25 | 25 | [#15597](https://github.com/angular/angular.js/issues/15597))
|
26 | 26 | - **$interval:** throw when trying to cancel non-$interval promise
|
27 | 27 | ([a8bef9](https://github.com/angular/angular.js/commit/a8bef95127775d83d80daa4617c33227c4b443d4),
|
| 28 | + [#16424](https://github.com/angular/angular.js/issues/16424), |
28 | 29 | [#16476](https://github.com/angular/angular.js/issues/16476))
|
29 | 30 | - **$timeout:** throw when trying to cancel non-$timeout promise
|
30 | 31 | ([336525](https://github.com/angular/angular.js/commit/3365256502344970f86355d3ace1cb4251ae9828),
|
31 |
| - [#16424](https://github.com/angular/angular.js/issues/16424)) |
| 32 | + [#16424](https://github.com/angular/angular.js/issues/16424), |
| 33 | + [#16476](https://github.com/angular/angular.js/issues/16476)) |
32 | 34 | - **$cookies:** remove the deprecated $cookieStore factory
|
33 | 35 | ([73c646](https://github.com/angular/angular.js/commit/73c6467f1468353215dc689c019ed83aa4993c77),
|
34 | 36 | [#16465](https://github.com/angular/angular.js/issues/16465))
|
@@ -727,7 +729,7 @@ angular.module('myModule', []).config(function($controllerProvider) {
|
727 | 729 | ```
|
728 | 730 |
|
729 | 731 | ### **$rootScope** due to:
|
730 |
| - - **([c2b8fa](https://github.com/angular/angular.js/commit/c2b8fab0a480204374d561d6b9b3d47347ac5570))**: provide correct value of one-time bindings in watchGroup |
| 732 | + - **[c2b8fa](https://github.com/angular/angular.js/commit/c2b8fab0a480204374d561d6b9b3d47347ac5570)**: provide correct value of one-time bindings in watchGroup |
731 | 733 |
|
732 | 734 | Previously when using `$watchGroup` the entries in `newValues` and
|
733 | 735 | `oldValues` represented the *most recent change of each entry*.
|
@@ -777,6 +779,59 @@ Where now the `oldValue` will always equal the previous `newValue`:
|
777 | 779 | | `b=2` | [1, 2] | [1, undefined] |
|
778 | 780 | | `a=b=3` | [3, 2] | [1, 2] |
|
779 | 781 |
|
| 782 | +### **$interval** due to: |
| 783 | + - **[a8bef9](https://github.com/angular/angular.js/commit/a8bef95127775d83d80daa4617c33227c4b443d4)**: throw when trying to cancel non-$interval promise |
| 784 | + |
| 785 | +`$interval.cancel()` will throw an error if called with a promise that |
| 786 | +was not generated by `$interval()`. Previously, it would silently do |
| 787 | +nothing. |
| 788 | + |
| 789 | +Before: |
| 790 | +```js |
| 791 | +var promise = $interval(doSomething, 1000, 5).then(doSomethingElse); |
| 792 | +$interval.cancel(promise); // No error; interval NOT canceled. |
| 793 | +``` |
| 794 | + |
| 795 | +After: |
| 796 | +```js |
| 797 | +var promise = $interval(doSomething, 1000, 5).then(doSomethingElse); |
| 798 | +$interval.cancel(promise); // Throws error. |
| 799 | +``` |
| 800 | + |
| 801 | +Correct usage: |
| 802 | +```js |
| 803 | +var promise = $interval(doSomething, 1000, 5); |
| 804 | +var newPromise = promise.then(doSomethingElse); |
| 805 | +$interval.cancel(promise); // Interval canceled. |
| 806 | +``` |
| 807 | + |
| 808 | +### **$timeout** due to: |
| 809 | + - **[336525](https://github.com/angular/angular.js/commit/3365256502344970f86355d3ace1cb4251ae9828)**: throw when trying to cancel non-$timeout promise |
| 810 | + |
| 811 | +`$timeout.cancel()` will throw an error if called with a promise that |
| 812 | +was not generated by `$timeout()`. Previously, it would silently do |
| 813 | +nothing. |
| 814 | + |
| 815 | +Before: |
| 816 | +```js |
| 817 | +var promise = $timeout(doSomething, 1000).then(doSomethingElse); |
| 818 | +$timeout.cancel(promise); // No error; timeout NOT canceled. |
| 819 | +``` |
| 820 | + |
| 821 | +After: |
| 822 | +```js |
| 823 | +var promise = $timeout(doSomething, 1000).then(doSomethingElse); |
| 824 | +$timeout.cancel(promise); // Throws error. |
| 825 | +``` |
| 826 | + |
| 827 | +Correct usage: |
| 828 | +```js |
| 829 | +var promise = $timeout(doSomething, 1000); |
| 830 | +var newPromise = promise.then(doSomethingElse); |
| 831 | +$timeout.cancel(promise); // Timeout canceled. |
| 832 | +``` |
| 833 | + |
| 834 | + |
780 | 835 | <a name="1.6.10"></a>
|
781 | 836 | # 1.6.10 crystalline-persuasion (2018-04-17)
|
782 | 837 |
|
|
0 commit comments