After a successful login to my app I want to dynamically load all states available to the user from api/js
. The dynamically loaded states will always include an abstract state app.module
which is the only known state and which is root to all other states in the same download.
My first approach was to use oc.lazyLoad after login. It worked fine, but not when refreshing the browser. I then tried to load using oc.lazyLoad in a module.run, but it didn't work.
I've been trying to use oc.lazyLoad together with futureState from ui-router extras but I can't get it to work.
I need some help with how to configure $futureStateProvider
, if it's even possible to do what I want.