Comments (8)
I have an inkling it has to do with ocLazyLoad reconfig flag, which has worked for me so far. But in this case, when loading the second lazy loaded state, it appears, the config blocks don't run for the lazy loaded module. I will create an issue there.
Any comments welcome.
from ui-router-extras.
from ui-router-extras.
@christopherthielen I was re-reading some docs when it dawned on me, I could be using the StateFactory
in an unspecified way. Docs state:
StateFactory factories convert a FutureState into a full UI-Router state
Question:
Was it your intent that a factory should just return 1 ui-router state? The case for me, often, is that once I know there is a facility that my application needs to provide, I need to register multiple states, all defined in a requirejs module. However, the StateFactory
recommendation for returning exactly one fullUiRouterState
seems limiting.
My Factory:
The promise of my factory doesn't return anything when using ocLazyLoad. I am relying on its reconfig
totally to get me the effect of loading all ui-router states.
Your Factory:
Along the similar lines, your example also doesn't return a ui-router state, although reading the code might confuse one into thinking that it does return an object.
The example code for ui-router-extras uses result.entryState
like such:
https://github.com/christopherthielen/ui-router-extras/blob/gh-pages/example/future/app.js#L79
However, module1 code never returns an entryState
through its requirejs module.
https://github.com/christopherthielen/ui-router-extras/blob/gh-pages/example/future/module1.js#L36
Are you aware of this anomaly?
Why I am using ocLazyLoad and not angularAMD
My angular modules are constructed using multi-file (separate for controllers, directives, services, states etc.) requirejs modules. angularAMD, as of current, doesn't support multi-file lazy require-module loading.
from ui-router-extras.
Hey, just wanted to let you that I'm very interested in your ocLazyLoad implementation.
You are correct about the docs being misleading regarding returning a full ui-router state. My ngload example is exactly doing what you think it's doing. I meant to go back and correct the API, but I've been extremely busy with back to back to back 70 hour work weeks.
I should come up to breathe next week and will be looking through your comments then. Keep this issue open!
from ui-router-extras.
#43 dupe
from ui-router-extras.
@christopherthielen as I guessed, there was an issue with ocLazyLoad missing config blocks in a certain case. Its fixed. My example is up and running, and so is a little post about my experience.
from ui-router-extras.
nice! When I have time I'll probably add ocLazyLoad into the ui-router-extras demo page based on your demo site, assuming that's ok with you.
from ui-router-extras.
Its absolutely ok with me. I am happy that people can get rolling with futureStates and multi-file requirejs modules. @christopherthielen
from ui-router-extras.
Related Issues (20)
- console.table is undefined in IE 11
- Exact url match instead of everything that follows HOT 1
- how to preload states - revisited HOT 1
- Cant get StateFactory to work the right way
- the params of "$previousState.set()" HOT 1
- $state.go is not working on ui-router 1.0.0-rc.1 for FutureState
- Error when importing ui-router-extras into app
- State change with "notify: false" refreshes sticky on next transition
- How to switch to a child state without losing hidden params? HOT 1
- End of Life, UI-Router v1.x and $previousState HOT 11
- Angular 1.6.5 Cannot read property '$$equals' of undefined HOT 4
- error : extend is not a function, injecting ct.ui.router.extras HOT 1
- Router doesn't resolve the child scope after the application is idle for at least 10 mins
- DSR Navigation not correctly stopped
- Sticky not working and routing failed after updating angular-ui-router @v1.0.15
- Error: [$injector:modulerr] Failed to instantiate module undefined due to: Error: [ng:areq] Argument 'fn' is not a function, got undefined
- Controller reloaded when params in route HOT 2
- $previousState is lost in case of page refresh
- DSR using params subset redirecting to the default state HOT 2
- Modules not loading after updating ui-router and angular 1.3 to 1.5.5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui-router-extras.