-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(component helper): remove hack get app root
#951
Comments
It was a hack to get root app scope, and seems it is not always working now ;( |
get app root
@ctrl-brk can you share a repo(sample) so I can test a fix? |
@valorkin The fix does not work for me. The injector in
Maybe there is a new way to access root components in a lazy loaded module. I tested the code with angular 2.0.0 by the way Trying to access the AppComponent directly in the constructor of the hosting component throws an error as well. Might be an angular bug or design choice after all: export class ComponentWithModal {
constructor(private appComponent: AppComponent) {
//throws No provider for AppComponent!
}
} |
@valorkin I created a repository to reproduce the bug. The page freezes when trying to open a modal. It works fine if the corresponding module is not lazy loaded. |
Please try 1.1.5, it is fixed |
RC6. Using modal component. Was working fine until I separated the application into modules. Now in lazy loaded module when I try to call .show() method I'm getting an error:
No provider for AppComponent!
As you may guessed the AppComponent is my main/default component in the app root module. How does this modal even know about AppComponent existence?
On StackOverflow: http://stackoverflow.com/questions/39431567/angular2-ng2-bootstrap-in-lazy-loaded-module-needs-app-root-module-for-some-rea
The text was updated successfully, but these errors were encountered: