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

Create reference to global app injector with bootstrapped providers #5973

Closed
dustinboss opened this issue Mar 28, 2016 · 0 comments
Closed
Assignees
Milestone

Comments

@dustinboss
Copy link

Short description of the problem:

Ionic's @app decorator handles the Angular bootstrap process, which is helpful, but it does not store a reference to the global app-injector, which is available after Angular's bootstrap() method resolves. There are cases when this injector is necessary to access the instantiated singleton version of a particular provider. This is sometimes necessary when injecting providers that depend on other providers. This issue is discussed here angular/angular#4112 (comment), and Brandon Roberts' solution of an appInjector() method has been used to solve a variety of dependency injection conflicts.

What behavior are you expecting?

Be able to reference the Angular Injector reference that is returned from the bootstrap() method. I have provided PR #5974 to facilitate this via the IonicApp provider

let appInjector = IonicApp.getAppInjector();

Which Ionic Version? 1.x or 2.x
2.0

Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: Not installed
Gulp version: CLI version 1.2.1
Gulp local: Local version 3.8.11
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v4.2.0
Xcode version: Xcode 7.2.1 Build version 7C1002

@jgw96 jgw96 added v2 labels Mar 29, 2016
@adamdbradley adamdbradley added this to the 2.0.0-beta.5 milestone Apr 19, 2016
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants