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

Commit 3768046

Browse files
committed
docs(migration.ngdoc): add missing breaking changes from #16476
Closes #16557
1 parent e3cb64b commit 3768046

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

docs/content/guide/migration.ngdoc

+52
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,58 @@ Where now the `oldValue` will always equal the previous `newValue`:
364364
| `a=b=3` | [3, 2] | [1, 2] |
365365

366366

367+
#### **$interval**
368+
369+
**Due to [a8bef9](https://github.com/angular/angular.js/commit/a8bef95127775d83d80daa4617c33227c4b443d4)**,
370+
`$interval.cancel() will throw an error if called with a promise that was not generated by
371+
`$interval()`. Previously, it would silently do nothing.
372+
373+
Before:
374+
```js
375+
var promise = $interval(doSomething, 1000, 5).then(doSomethingElse);
376+
$interval.cancel(promise); // No error; interval NOT canceled.
377+
```
378+
379+
After:
380+
```js
381+
var promise = $interval(doSomething, 1000, 5).then(doSomethingElse);
382+
$interval.cancel(promise); // Throws error.
383+
```
384+
385+
Correct usage:
386+
```js
387+
var promise = $interval(doSomething, 1000, 5);
388+
var newPromise = promise.then(doSomethingElse);
389+
$interval.cancel(promise); // Interval canceled.
390+
```
391+
392+
393+
#### **$timeout**
394+
395+
**Due to [336525](https://github.com/angular/angular.js/commit/3365256502344970f86355d3ace1cb4251ae9828)**,
396+
`$timeout.cancel() will throw an error if called with a promise that was not generated by
397+
`$timeout()`. Previously, it would silently do nothing.
398+
399+
Before:
400+
```js
401+
var promise = $timeout(doSomething, 1000).then(doSomethingElse);
402+
$timeout.cancel(promise); // No error; timeout NOT canceled.
403+
```
404+
405+
After:
406+
```js
407+
var promise = $timeout(doSomething, 1000).then(doSomethingElse);
408+
$timeout.cancel(promise); // Throws error.
409+
```
410+
411+
Correct usage:
412+
```js
413+
var promise = $timeout(doSomething, 1000);
414+
var newPromise = promise.then(doSomethingElse);
415+
$timeout.cancel(promise); // Timeout canceled.
416+
```
417+
418+
367419
#### **$cookies**
368420
**Due to [73c646](https://github.com/angular/angular.js/commit/73c6467f1468353215dc689c019ed83aa4993c77)**,
369421
the `$cookieStore`service has been removed. Migrate to the $cookies service. Note that

0 commit comments

Comments
 (0)