From e3cb64b9e4aab003e97b8aec4df3a8c84e7162af Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Sat, 5 May 2018 12:38:34 +0300 Subject: [PATCH] docs(CHANGELOG.md): add missing breaking changes from #16476 Closes #16556 --- CHANGELOG.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4303ef12a030..74b19232bb85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,10 +25,12 @@ [#15597](https://github.com/angular/angular.js/issues/15597)) - **$interval:** throw when trying to cancel non-$interval promise ([a8bef9](https://github.com/angular/angular.js/commit/a8bef95127775d83d80daa4617c33227c4b443d4), + [#16424](https://github.com/angular/angular.js/issues/16424), [#16476](https://github.com/angular/angular.js/issues/16476)) - **$timeout:** throw when trying to cancel non-$timeout promise ([336525](https://github.com/angular/angular.js/commit/3365256502344970f86355d3ace1cb4251ae9828), - [#16424](https://github.com/angular/angular.js/issues/16424)) + [#16424](https://github.com/angular/angular.js/issues/16424), + [#16476](https://github.com/angular/angular.js/issues/16476)) - **$cookies:** remove the deprecated $cookieStore factory ([73c646](https://github.com/angular/angular.js/commit/73c6467f1468353215dc689c019ed83aa4993c77), [#16465](https://github.com/angular/angular.js/issues/16465)) @@ -727,7 +729,7 @@ angular.module('myModule', []).config(function($controllerProvider) { ``` ### **$rootScope** due to: - - **([c2b8fa](https://github.com/angular/angular.js/commit/c2b8fab0a480204374d561d6b9b3d47347ac5570))**: provide correct value of one-time bindings in watchGroup + - **[c2b8fa](https://github.com/angular/angular.js/commit/c2b8fab0a480204374d561d6b9b3d47347ac5570)**: provide correct value of one-time bindings in watchGroup Previously when using `$watchGroup` the entries in `newValues` and `oldValues` represented the *most recent change of each entry*. @@ -777,6 +779,59 @@ Where now the `oldValue` will always equal the previous `newValue`: | `b=2` | [1, 2] | [1, undefined] | | `a=b=3` | [3, 2] | [1, 2] | +### **$interval** due to: + - **[a8bef9](https://github.com/angular/angular.js/commit/a8bef95127775d83d80daa4617c33227c4b443d4)**: throw when trying to cancel non-$interval promise + +`$interval.cancel()` will throw an error if called with a promise that +was not generated by `$interval()`. Previously, it would silently do +nothing. + +Before: +```js +var promise = $interval(doSomething, 1000, 5).then(doSomethingElse); +$interval.cancel(promise); // No error; interval NOT canceled. +``` + +After: +```js +var promise = $interval(doSomething, 1000, 5).then(doSomethingElse); +$interval.cancel(promise); // Throws error. +``` + +Correct usage: +```js +var promise = $interval(doSomething, 1000, 5); +var newPromise = promise.then(doSomethingElse); +$interval.cancel(promise); // Interval canceled. +``` + +### **$timeout** due to: + - **[336525](https://github.com/angular/angular.js/commit/3365256502344970f86355d3ace1cb4251ae9828)**: throw when trying to cancel non-$timeout promise + +`$timeout.cancel()` will throw an error if called with a promise that +was not generated by `$timeout()`. Previously, it would silently do +nothing. + +Before: +```js +var promise = $timeout(doSomething, 1000).then(doSomethingElse); +$timeout.cancel(promise); // No error; timeout NOT canceled. +``` + +After: +```js +var promise = $timeout(doSomething, 1000).then(doSomethingElse); +$timeout.cancel(promise); // Throws error. +``` + +Correct usage: +```js +var promise = $timeout(doSomething, 1000); +var newPromise = promise.then(doSomethingElse); +$timeout.cancel(promise); // Timeout canceled. +``` + + # 1.6.10 crystalline-persuasion (2018-04-17)