Skip to content

Ui router vs angular routing

Luke Aldworth Davis edited this page Oct 31, 2015 · 3 revisions

Some of these are probably more subjective that objective, but I will try to be as fair to UI Router as I can.

Angular Routing Advantages

  • Seperation of Application State and View State
  • Full support for transition control between state, not just enter/exit or a global state changed handler
  • A Simpler view model that still adds more flexibility through the view service
  • Sibling lookup in terms of "next" and "prev".
  • Parameter converters, UI Router has support for regex parameters but it seems more limited
  • Providing means to simply refresh views rather than reloading templates as well (see sticky and $view-refresh)
  • Enhancement of scrolling.
  • Support for simple loaders if resolve is used.

UI Router Advantages

  • Un-nanmed views.
  • Abstract states. (Angular Routing don't need them)
  • Support for route matching through functions.
  • More used.
  • Smaller footprint.
  • Compatible with angular 1.0.x

Names, Services and Concepts that compares

I will try to give an overview over things that are different yet provide the same basic feature.

UI Router Angular Routing Comments
<div ui-view="name" /> <div jem-view="name" /> View names are enforced for Angular Routing
<a ui-sref="state({ id: contact.id })" /> <div sref="'state'" params="{ id: contact.id }" /> View names are enforced for Angular Routing
Clone this wiki locally