ktom
ktom

Reputation: 226

UI-router vs. NgRoute in Angular2

If somebody has experience about ui router and ngroute in Angular2, please let me know about this. Which are pros and cons? Which is the best choice in a new project? If somebody found a useful link about this topic please linked it.

Upvotes: 2

Views: 1227

Answers (1)

Oliver Castillo
Oliver Castillo

Reputation: 337

If i would have to start a project today, probably i would use NgRoute.

UI-Router for angular 2 is still beta and documentation is incomplete and not clear enough. I really love the approach of managing state for routes as UI-Router does. It's make easy to rename routes when you need it and you could have states without urls.

NgRoute has change a lot since angular 1. You can achieve most of functionality of uiRouter and documentation is extensive with a lot of examples. I was able to migrate a project from UI-Router to NgRoute, i had to do it because an issue related to AOT (fixed in beta 4).

So, if is very short project, i would use NgRoute because UI-Router is still beta and documentation is poor.

Probably for long term project i would bet for UI-Router because my previous experiences with it.

https://angular.io/docs/ts/latest/guide/router.html

https://ui-router.github.io/ng2/

https://github.com/ui-router/ng2/issues/29

Upvotes: 2

Related Questions