-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not possible to use Angular without Zone because of Router.setUpLocationChangeListener #20582
Comments
@mhevery , should we provide a empty Zone implementation when use NgNoopZone? such as for this issue, if (!global['Zone']) {
function NoopZone() {
wrap(func) {
return func;
}
...
}
global['Zone'] = NoopZone;
NoopZone.current = new NoopZone();
} or provide a if (!global['Zone']) {
function NoopZone() {
wrap(func) {
return function() {
const result = func.apply(this, arguments);
changeDetectRef.detectChange();
} ;
}
...
}
global['Zone'] = NoopZone;
NoopZone.current = new NoopZone();
} |
@JiaLiPassion Instead of creating a noop mock, we should just remove that code from router. It seems like that 25e5b2f#diff-7f0963cbc503a361ded7d2bfec5f01b9R386 is there because zone.js does not properly patch the |
@mhevery , got it, I will look into it. |
Thanks a lot for your attention to this issue! seems I can close it? |
@ArekSliwa, if my PR is correct, after merge , this issue will be closed automatically, thank you for posting the issue. |
@JiaLiPassion Thank you for your PR. I am currently running into the same issue and was wondering if you could give an update on this issue. It looks like Travis is complaining about errors while testing. |
@me-12 , the travis is passed in the PR, do you mean some test failed in your travis build ? |
@JiaLiPassion Sorry my bad. I was looking at your fork instead of the PR. #20640 So we are just waiting for @mhevery to review the PR again. Right? |
@me-12, yeah, I think so. please wait for a while. |
Any news? |
Wow, hope finally it works) |
…nge listener (angular#20640) PR Close angular#20640
…nge listener (angular#20640) PR Close angular#20640
…nge listener (angular#20640) PR Close angular#20640
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
When using Angular Router it's not possible to use new Angular 5 feature ngZone: 'noop' .
In the console we can see: Zone is not defined error.
Router method setUpLocationChangeListener is using Zone.
screenshots:
zone is not defined
Router.setUpLocationChangeListener method implementation
Expected behavior
Angular Router is able to work without Zone.
Minimal reproduction of the problem with instructions
platformBrowserDynamic()
.bootstrapModule(AppModule, {
ngZone: 'noop'
});
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: