christopherthielen / ui-router-extras

THIS PROJECT IS NO LONGER MAINTAINED -- Extras for UI-Router for AngularJS. Sticky States (a.k.a. parallel states), Deep State Redirect (for tab-like navigation), Future States (async state definition)
http://christopherthielen.github.io/ui-router-extras/
MIT License
915 stars 211 forks source link

Mapping urls to states that dont exist #341

Open ashiquemohammed opened 8 years ago

ashiquemohammed commented 8 years ago

I am using ui-router-extras extensively but still not sure if I am getting the most out of it . I have used Future States to build the routes in runtime after retrieving from the API . I am trying to solve a case , where ui-tabs dynamically created with the data in the controller , and I need to create states for them when the tabs are created .

Just so that , hitting , /tabs/ that has tabs but nothing selected should create the states and , hitting /tabs/1 should show the first tab.

I tried to implement this by creating the states in the controller , but hitting /tabs/1 does not activate the tab but instead redirects to the default url because the state is not created yet .

Any help appreciated .

http://stackoverflow.com/questions/39654888/mapping-urls-to-states-that-dont-exist

christopherthielen commented 8 years ago

If you're using ui-router-extras only for future states, you might have better luck with ui-router 1.0 beta. It has support for lazy loading and adding/removing states on the fly baked in.

ashiquemohammed commented 8 years ago

@christopherthielen: I am using ui-router-extras for having stateful tabs / modals and for registering states only when the url is hit . Would that be possible ? I ui-router 1.0 is still in early stage and lacks docs.

christopherthielen commented 8 years ago

I'm asking which features of ui-router-extras are you using?

Your choices are:

So far I know you're using Future States and I want to know if that's the only feature from extras that you are using.

ui-router 1.0 is almost final, by the way and docs are available at https://ui-router.github.io/docs/latest/

ashiquemohammed commented 8 years ago

@christopherthielen : What I am trying to achieve and failed successfully is to have Stateful tabs/modals for which the states (that don't exist yet) will be defined in the controller or in some file that will be lazy loaded . I have used , sticky states , future states and deep state redirect but could not get it to work for my usecase . Could you help me out ?