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

Expose application tokens via ngProbe for chrome extensions, ... #7045

Closed
tbosch opened this issue Feb 12, 2016 · 3 comments
Closed

Expose application tokens via ngProbe for chrome extensions, ... #7045

tbosch opened this issue Feb 12, 2016 · 3 comments
Assignees
Labels
effort1: hours feature Issue that requests a new feature

Comments

@tbosch
Copy link
Contributor

tbosch commented Feb 12, 2016

Chrome extensions don't know which module loader is being used in the application under test. They can get hold of the injector at elements via ngProbe and DebugNode, but they can't access things like ApplicationRef or NgZone as they don't have access to their types to pass into the DebugNode.inject(<token>.

Solution: Provide all exports of angular2/core via a property on ngProbe.ngCore.

@tbosch
Copy link
Contributor Author

tbosch commented Feb 12, 2016

This is blocking batarangle

@tbosch tbosch added feature Issue that requests a new feature comp: core effort1: hours labels Feb 12, 2016
@tbosch tbosch self-assigned this Feb 12, 2016
tbosch added a commit to tbosch/angular that referenced this issue Feb 18, 2016
…wser

Adds `window.getAllAngularRootElements()`
Adds `ng.probe.coreTokens.ApplicationRef`
Adds `ng.probe.coreTokens.Ngzone`

Closes angular#7045
@tbosch
Copy link
Contributor Author

tbosch commented Feb 18, 2016

with #7161 you can:

var ngRootEl = window.getAllAngularRootElements()[0];
var rootNgProbe = window.ng.probe(ngRootEl);
var appRef = rootNgProbe.inject(window.ng.probe.coreTokens.ApplicationRef);
appRef.tick();

var ngZone = rootNgProbe.inject(window.ng.probe.coreTokens.NgZone);
ngZone.onEventDone.subscribe(function() { console.log('Angular did some work'); });

tbosch added a commit to tbosch/angular that referenced this issue Feb 19, 2016
…wser

Adds `window.getAllAngularRootElements()`
Adds `ng.coreTokens.ApplicationRef`
Adds `ng.coreTokens.Ngzone`

Closes angular#7045
matsko pushed a commit to matsko/angular that referenced this issue Feb 20, 2016
…wser

Adds `window.getAllAngularRootElements()`
Adds `ng.coreTokens.ApplicationRef`
Adds `ng.coreTokens.Ngzone`

Closes angular#7045
@mhevery mhevery closed this as completed in b5e6319 Mar 1, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: hours feature Issue that requests a new feature
Projects
None yet
1 participant