X Tutup
Skip to content

ngUpgrade executes digest outside "angular" zone causing issues #12034

@dtabuenc

Description

@dtabuenc

I'm submitting a ...

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
When running a hybrid ng1/ng2 application ngUpgrade subscribes to the onMicrotaskEmpty and then executes the angular1 digest within an ngZone.runOutsideAngular().

This was behavior was introduced by this pull request in order to try to fix the problem of infinite digests:

#6386 (issue #8004)

Expected behavior

All angular 1 digests must happen inside the angular zone. Digest could potentially setup timeouts, intervals, oveservables etc... that should then cause change detection to trigger. If the digest cycle is running outside of the angular zone, these things will forever leak into the root zone and never trigger future change detections.

Minimal reproduction of the problem with instructions

https://plnkr.co/edit/JH2NNHxIscInf4S1Dtg4?p=preview

What is the motivation / use case for changing the behavior?

This will cause a lot of subtle bugs and weird behaviors due to change detection not triggering.

Please tell us about your environment:

  • Angular version: 2.0.1

  • Browser: all

  • Language: all

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

      X Tutup