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

ZoneTask.toString() method missing #341

Closed
@char0n

Description

@char0n

I have reported this issue to AngularJs team: angular/angular.js#14548

Basically their are right in their assumption that using zone.js should not change setTimeout. Imagine this situation when using zone.js.

var deferredTracker = {}

var timerId1 = setTimeout(function() {});
var timerId2 = setTimeout(function() {});

deferredTracker[timerId1] = new Promise(....);
defferedTracker[timerId2] = new Promise(....);

The result of defferedTracker is:

{"[object Object]": promiseInstance}

This is the way angular1 tracks timeouts and interval. Using zone.js allows to cancel only the last timeout or interval.

To fix this issue I would suggest for ZoneTask to have toString method which for setTimeout and setInterval should look like this:

toString: function() {
  return this.data.handleId;
} 

Without fixing this, using zone.js in angular1 application is just not possible.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions