You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have AngularJS app which builds it's UI according to API input data . All information about routes are inside my input data so I can't configure routes after/during building UI. I need a possibility to configure routes after/during UI building.
The text was updated successfully, but these errors were encountered:
You can hang onto the $stateProvider and register states on the fly. If you fetch all the states before synchronizing with the URL, it's pretty easy. If you want to register after the user logs in, for instance, there are some more subtle nuances that may cause difficulty.
Easy mode:
varstateProviderapp.config($stateProvider,$urlRouterProvider){stateProvider=$stateProvider;$urlRouter.deferIntercept();// Dont sync the URL yet}app.run(($http,$urlRouter)=>{// get routes$http.get('states.json').then(resp=>{// got routes; register them with the state providerresp.data.forEach(state=>stateProvider.state(state));// tell ui-router to sync the url and listen for changes$urlRouter.listen();$urlRouter.sync();});})
I have AngularJS app which builds it's UI according to API input data . All information about routes are inside my input data so I can't configure routes after/during building UI. I need a possibility to configure routes after/during UI building.
The text was updated successfully, but these errors were encountered: