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 @uirouter/angular
npx check-peer-dependencies --install

Tutorials

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.

Development

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