UI-Router for Angular (2+)

UI-Router provides extremely flexible, state based routing to the Angular (2+) ecosystem.

Getting UI-Router

The UI-Router package is distributed using npm, the node package manager.

npm install --save @uirouter/angular

Other examples:

  • Adding a specific version to your project: npm install --save @uirouter/angular@1.0.0-beta.7
  • From http://unpkg.com via a <script> tag in your html:
    • Latest stable version: <script src="//unpkg.com/@uirouter/angular/_bundles/ui-router-ng2.js"></script>
    • A specific version: <script src="//unpkg.com/@uirouter/angular@1.0.0-beta.7/_bundles/ui-router-ng2.js"></script>


Learn UI-Router by following our tutorials.

Quick Start

The UI-Router Ng2 QuickStart is a minimalistic Angular (2+) UI-Router app generated with Angular CLI. It demonstrates:

  • States and nested substates
  • Path, Query, and Hash parameters
  • Resolve data
  • Named Views

Sample application

The UI-Router Sample App is a non-trivial UI-Router application.


To fix a UI-Router bug, or create an enhancement, follow these steps:

The Typescript source code for UI-Router for Angular (2+) can be found at https://github.com/ui-router/ng2 UI-Router for Angular (2+) depends on UI-Router Core, which can be found at https://github.com/ui-router/core

To get started:

mkdir uirouter
cd uirouter
git clone https://github.com/ui-router/angular
git clone https://github.com/ui-router/core
cd core
npm install
npm link
npm run build

cd ../angular
npm install
npm link @uirouter/core
npm run build