Angular 1.5.5 + zone.js #14548
Description
Note: for support questions, please use one of these channels: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.
Do you want to request a feature or report a bug?
I would suggest this this is bug. Running hybrid application using angular1 and angular2 should be possible according to the documentation. One of the requirements of angular2 applications is zone.js (https://github.com/angular/zone.js).
What is the current behavior?
zone.js patches the window.setTimeout and window.setInterval functions (all other async apis are also patched). These functions no longer returns unique integers to track the timers, but instead they return the ZoneTask objects. ZoneTask doesn't have toString() method implemented so all the pending deferreds ends up in Browser.pendingDeferIds under property name '[object Object]'. This effectively takes the opportunity to cancel the deferreds.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
var p1 = $timeout(() => {});
var p2 = $timeout(() => {});
$timeout.cancel(p1); // This cancels the second not the first timeout
The same behavior can be seen on $interval service.
What is the expected behavior?
var p1 = $timeout(() => {});
var p2 = $timeout(() => {});
$timeout.cancel(p1); // This cancells p1 only.
What is the motivation / use case for changing the behavior?
The be able to run angular1 <-> angular2 hybrid application and to migrate angular1 codebase progressively to angular2.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
angular=1.5.5
angular2=2.0.0-beta.17
zone.js=0.6.12
Other information (e.g. stacktraces, related issues, suggestions how to fix)