Skip to content
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

add zone.js for flawless integration with RxJs 5 in Angular 1 mode #85

Open
Hotell opened this issue May 10, 2016 · 4 comments
Open

add zone.js for flawless integration with RxJs 5 in Angular 1 mode #85

Hotell opened this issue May 10, 2016 · 4 comments

Comments

@Hotell
Copy link
Member

Hotell commented May 10, 2016

we need to call time to time @scope.$applyAsync when using RxJS 5 and Angular 1 + ngMetadata.
If we could integrate zone.js it would done that for us.

Once user will switch to hybrid mode ng1/ng2 by including ng-metadata/upgrade this would be disabled, because that Zones thingy, will be handled by Angular 2

@aciccarello
Copy link
Collaborator

Would zone.js be required or optional?

@Hotell
Copy link
Member Author

Hotell commented May 11, 2016

Optional of course. Leave the users choose what they want is my motto with this one! :)

To enable it, It would look like within your main.ts

import 'zone.js';
import {enableZones} from 'ng-metadata/upgrade';

enableZones();

Or something like that

@Hotell Hotell added this to the 2.0 milestone Jun 11, 2016
@Hotell Hotell modified the milestones: 2.1, 2.0 Jun 26, 2016
@Hotell Hotell modified the milestone: 2.1 Oct 15, 2016
@hworld
Copy link

hworld commented Dec 29, 2016

Hey, I'm curious about the effort involved. Implementing this would bring you much closer to the angular2 style API by allowing to get rid of $q completely, yeah? Async/await would be possible, then, as well. And since TS 2.1 now emits async/await for ES5, it'd be usable in most projects.

I guess it could break some apps since zone.js will always hook into events. For example, scroll events would automatically be $scope.applying? You'd have to know to pull that out of the zone, yeah?

Sorry, this may not be on the radar, but integrating zone.js into ng1 would be pretty awesome.

@gitawego
Copy link

this is a must feature for ng-metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants