Closed milosz-pawlicki closed 4 years ago
Why are you trying to load 2700 routes at application startup? Have you tried lazy loading your routes definitions?
In our application we also have hundreds of routes, but we register them dynamically once the user visits a feature module.
Example:
$stateProvider.state("orders.**", {
url: '/orders',
lazyLoad: lazyLoad('OrdersModule') // function which loads an AngularJS module by name
});
This will register only top-level feature routes on application start, but the modules' routes will be registered once the user actually visits the orders/**
pages. In our case each module has it's own route definitions inside.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This does not mean that the issue is invalid. Valid issues may be reopened.
Thank you for your contributions.
This issue tracker is for Bug Reports and Feature Requests only.
Please direct requests for help to StackOverflow. See http://bit.ly/UIR-SOF for details.
This is a (check one box):
My version of UI-Router is: (type version) 1.0.11
Bug Report
Current Behavior:
On application start when we register about 2700 routs it takes about 30seconds. Previously because we had angular 1.4.9 we were using ui router in version 0.3.1 where registering routes was very fast (1-2 seconds). Can you explain why stateRegistry.register takes that long? is it a bug or we should use another way to register routes? Please answer as quickly as possible because we have deadline with production release and we need to fix it quickly
Expected Behavior:
faster registering routes
Link to Plunker or stackblitz that reproduces the issue:
( if you want a response to your issue, provide a way to reproduce it ) ( http://bit.ly/UIR-Plunk1 ) ( https://stackblitz.com/edit/ui-router-angularjs )
Feature Request
(type feature request here)
General Query
Please direct general implementation questions to StackOverflow: http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router
Please review the Sample Application which highlights common approaches: https://github.com/ui-router/sample-app-angularjs
[ ] I have already asked my question on StackOverflow and nobody could answer the question
[ ] I have already reviewed the sample application for examples of common approaches
[x ] I believe my question can only be answered by the UI-Router maintainers
(type general query here)