-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Future States & OcLazyLoading #3147
Comments
Is any of it working? Do you get any error messages? Here's a plunker that demonstrates lazy loading angular 1 module: http://plnkr.co/edit/a3r5BY4o669RBAm8plKI?p=preview I see one problem with lazy loading the See my analysis of the bug here: #3102 (comment) and the fix here: #3134 The issue described in #3102 is fixed in master and will be part of beta.4. You can work around the problem in beta.3 by adding Let me know if this helps. If not, please provide more information about how it's failing. |
Hi Christopher, Thank you very much for your quick response, it works for parent states but I can't get it working on child states: app.router.js WORKS OK! .state('section1', <ng.ui.IState> {
name: 'section1',
url: '/section1',
lazyLoad: (transition) => transition.injector().get('$ocLazyLoad').load(['app/js/components/view/section1/section1.component.min.js','app/js/components/view/section1/section1.module.min.js'])
}) section1.module.js WORKS OK! angular
.module("section1", ['ui.router'])
.config(['$stateProvider',($stateProvider) => {
$stateProvider
.state('section1', {
url: '/section1',
component: 'viewSection1'
})
.state('section1.subsection1', {
url: '/section1/subsection1',
lazyLoad: (transition) =>
transition.injector().get('$ocLazyLoad').load(['app/js/components/view/section1/subsections/subsection1/subsection1.component.min.js','app/js/components/view/section1/subsections/subsection1/subsection1.module.min.js'])
})
}])
.component('viewSection1', Section1Component); subsection1.module.js DOESN'T WORK angular
.module("subsection1", ['ui.router'])
.config(['$stateProvider',($stateProvider) => {
$stateProvider
.state('section1.subsection1', {
url: '/section1/subsection1',
component: 'viewSubsection1'
})
}])
.component('viewSubsection1', Subsection1Component); If I change the subsection1's state from "section1.subsection1" to "subsection1" works. Am I doing something wrong? Thanks again for your great work :) Aleix |
@MacrofonoEstudio If you would like to try building ui-router yourself to test if the fix for #3146 fixes your situation, you can do so by following the development instructions If you try building yourself, let me know if there are any issues with the instructions. |
Hi @christopherthielen , Thank you for your reply, I'm trying it by ui-sref. I have tried to the onEnter property too, but I can't get it working (doesn't console any error). I've also tried the fix (ui-router/react#7) but no luck. I've come with a temporary solution emulating a parent state with the redirect property:
When do you plan the next release that fixes this issue? Thank you very much! |
Hi @christopherthielen , |
RC.1 is released. Try it now! Note the breaking change in release notes about future states:
If this works for you now, can you close it? If not, can you post a plunker that reproduces the issue? Thanks! |
@christopherthielen because it stopped working and I was trying to figure out what the problem was until I've found this comment. Thanks |
@serkanyersen I updated it, thanks for the note! |
Thanks. |
@christopherthielen I have written my code as in your example, But my concern is that 'somestate.**' is being destroyed even when the loading fails. In the example you have provided, I see that you are using @Version v1.0.0-rc.1 could this be the reason? |
@raviteja-kvns it should not remove the
|
@christopherthielen Plunkr: http://plnkr.co/edit/calGSdZMXDiNwNipstYO?p=preview Problem: Moved the nested state "lazy.foo" to the dependency module "lazyChild" and the nested state won't work. I'm assuming because the nested state config block is run before the parent state is configured. Wondering if you happen to know a way around this problem. Note: as shown in the plunkr. using oclazyload "serie" doesn't work. Thanks. It looks like an existing issue might already cover this problem: #3375 |
Hi Ui-routers,
Thank you for your great work!
I'm trying to get Future States & OcLazyLoading working together like this:
In app.router.js
In view.routes.min.js
And... Is not working. Could you point me in the right direction?
Thanks!
The text was updated successfully, but these errors were encountered: