Skip to content

Commit e3cb64b

Browse files
committed
docs(CHANGELOG.md): add missing breaking changes from angular#16476
Closes angular#16556
1 parent fb2d3fa commit e3cb64b

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

CHANGELOG.md

+57-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
[#15597](https://github.com/angular/angular.js/issues/15597))
2626
- **$interval:** throw when trying to cancel non-$interval promise
2727
([a8bef9](https://github.com/angular/angular.js/commit/a8bef95127775d83d80daa4617c33227c4b443d4),
28+
[#16424](https://github.com/angular/angular.js/issues/16424),
2829
[#16476](https://github.com/angular/angular.js/issues/16476))
2930
- **$timeout:** throw when trying to cancel non-$timeout promise
3031
([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))
3234
- **$cookies:** remove the deprecated $cookieStore factory
3335
([73c646](https://github.com/angular/angular.js/commit/73c6467f1468353215dc689c019ed83aa4993c77),
3436
[#16465](https://github.com/angular/angular.js/issues/16465))
@@ -727,7 +729,7 @@ angular.module('myModule', []).config(function($controllerProvider) {
727729
```
728730

729731
### **$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
731733

732734
Previously when using `$watchGroup` the entries in `newValues` and
733735
`oldValues` represented the *most recent change of each entry*.
@@ -777,6 +779,59 @@ Where now the `oldValue` will always equal the previous `newValue`:
777779
| `b=2` | [1, 2] | [1, undefined] |
778780
| `a=b=3` | [3, 2] | [1, 2] |
779781

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+
780835
<a name="1.6.10"></a>
781836
# 1.6.10 crystalline-persuasion (2018-04-17)
782837

0 commit comments

Comments
 (0)