-
Notifications
You must be signed in to change notification settings - Fork 75
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
States from NgModules not registered at bootstrap #17
Comments
Ah. I was wondering about that. I haven't been creating lazy-loaded routes since I haven't seen any examples of how to do it with Webpack. |
We're still having this issue. When we use the visualiser, we can see that states declared on any NgModule are not loaded. But when we navigate to an ng1-declared state which uses an ng2 component, all the NgModule-declared states then appear. Can't work out why... We're using Webpack, no lazy loading. |
Both We need to inject something ng2 for UIRouter Try this:
function readyFn(ref: UpgradeAdapterRef) {
// Causes ng2 ui-router bootstrap to happen
ref.ng2Injector.get(UIView); // geta an ng2 class to trigger DI
let $urlRouter = ref.ng1Injector.get('$urlRouter');
$urlRouter.listen();
$urlRouter.sync();
}
upgradeAdapter.bootstrap(document.body, [...]).ready(readyFn); This is conceptually similar to ng1 inject in a
|
Only states from a lazy loaded module are registered. States in the NgModule being bootstrapped are not registered.
The text was updated successfully, but these errors were encountered: