Ui router vs ngroute for sinlge page app

I am starting a new angular project (single-page application) that will have complex views (dialogs, wizards, pop-ups, loaders), although the exact requirements are not yet clear.

Should i use ui.router upfront? Or should I start with ngRoute and change to ui.router if necessary?

What is the advantage ui.router has ngRoute? What are the limitations that can make me choose ui.router?

From my research, it seems that ui.router does a lot more than ngRoute, I will try to avoid complexity as long as possible.

I read What is the difference between angular-route and angular -ui-router? but does not help (I am the result of angular noob).

I have good skills in js, jquery, html though.

+7
javascript jquery angularjs html5 single-page-application
source share
2 answers

I suggest going with ui.router, why?

  • almost as complicated as ngRoute

  • it will allow you to use the same view on a page, pop-up menu or container on another page

  • more readable code

    /book/{{book.nameasket}/Chapter/{{chapter.name}}

    vs

    book.chapter ({chapter: chapter.name})

  • and you will observe the power of ui.router more, as you dive deeper into angular.

Trying to save this is simple, given that you are "angular noob" :-).

+5
source share

I would recommend starting with uiRouter, it can do almost everything ngRouter can do, and much more (for example, nested routes, views, etc.). I think the only one that has ngRouter, but uiRouter is not an optional URL parameter.

+1
source share

All Articles