ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

Huge amount of states - Best Practice

Open seinavco opened this issue 11 years ago • 3 comments

Hello all,

I have a huge amount of states in my application (about 60 states/sub states).

Now there are all in one file (app.js). Is there any tool or suggestion that I can separate my routing into separate file? Is there a best practice for this kind of scenarios?

Thank every one for the help.

seinavco avatar Dec 23 '14 11:12 seinavco

sure - you can do a module config on any module and specify the module relevant states there.

Tallyb avatar Dec 23 '14 11:12 Tallyb

:+1: to @Tallyb

That's exactly what I do, and I have far fewer than 60 states. Separate your app into logical modules (not functional, like 'module.directives', but like 'module.users', or 'module.catalog') and set your relevant states inside each of those modules separately.

RobiFerentz avatar Dec 23 '14 12:12 RobiFerentz

Please direct general and support questions to StackOverflow: http://bit.ly/UIR-SOF

nateabele avatar Dec 23 '14 14:12 nateabele