{"_id":"ui-router","_rev":"20-acb7002f8f5eedb183a218432dc66cbd","name":"ui-router","time":{"modified":"2022-06-28T03:21:40.994Z","created":"2014-02-04T08:00:41.224Z","0.0.1":"2014-02-04T18:07:05.846Z","0.2.15":"2015-10-15T19:43:22.628Z","1.0.0-alpha0":"2016-02-29T05:02:51.800Z","1.0.0-alpha.3":"2016-04-08T01:22:32.328Z"},"maintainers":[{"name":"jesscold","email":"jess@cold.co"}],"dist-tags":{"latest":"1.0.0-alpha.3"},"description":"State-based routing for Javascript","readme":"# AngularUI Router &nbsp;[![Build Status](https://travis-ci.org/angular-ui/ui-router.svg?branch=master)](https://travis-ci.org/angular-ui/ui-router)\n\n**Note: this is the Angular 1.x source for UI-Router version 1.0 alpha.  If you are looking for the source for UI-Router \nversion 0.2.x, it can be found [here](https://github.com/angular-ui/ui-router/tree/legacy)**\n\n---\n\n\n#### The de-facto solution to flexible routing in angular\n---\n**[Docs 1.0.0-alpha.3](http://angular-ui.github.io/ui-router/1.0.0-alpha.3)** |\n**[Download stable](http://angular-ui.github.io/ui-router/release/angular-ui-router.js)** (or **[Minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js)**) **|**\n**[Guide](https://github.com/angular-ui/ui-router/wiki) |**\n**[API](http://angular-ui.github.io/ui-router/site) |**\n**[Sample](http://ui-router.github.io/sample-app/#/mymessages) ([Src](https://github.com/ui-router/sample-app)) |**\n**[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |**\n**[Resources](#resources) |**\n**[Report an Issue](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#report-an-issue) |**\n**[Contribute](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#contribute) |**\n**[Help!](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |**\n\n\n---\n\nAngular UI-Router is a client-side [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application) \nrouting framework for [AngularJS](http://angularjs.org).  \n  \nRouting frameworks for SPAs update the browser's URL as the user nagivates through the app.  Conversely, this allows \nchanges to the browser's URL to drive navigation through the app, thus allowing the user to create a bookmark to a \nlocation deep within the SPA.\n\nUI-Router applications are modeled as a hierarchical tree of states. UI-Router provides a \n[*state machine*](https://en.wikipedia.org/wiki/Finite-state_machine) to manage the transitions between those \napplication states in a transaction-like manner. \n\n## Get Started\n\n**(1)** Get UI-Router in one of the following ways:\n - clone & [build](CONTRIBUTING.md#developing) this repository\n - [download the release](http://angular-ui.github.io/ui-router/release/angular-ui-router.js) (or [minified](http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js))\n - [link to cdn](http://cdnjs.com/libraries/angular-ui-router)\n - via **[jspm](http://jspm.io/)**: by running `$ jspm install angular-ui-router` from your console\n - or via **[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console\n - or via **[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console\n - or via **[Component](https://github.com/component/component)**: by running `$ component install angular-ui/ui-router` from your console\n\n**(2)** Include `angular-ui-router.js` (or `angular-ui-router.min.js`) in your `index.html`, after including Angular itself (For Component users: ignore this step)\n\n**(3)** Add `'ui.router'` to your main module's list of dependencies (For Component users: replace `'ui.router'` with `require('angular-ui-router')`)\n\nWhen you're done, your setup should look similar to the following:\n\n>\n```html\n<!doctype html>\n<html ng-app=\"myApp\">\n<head>\n    <script src=\"//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js\"></script>\n    <script src=\"js/angular-ui-router.min.js\"></script>\n    <script>\n        var myApp = angular.module('myApp', ['ui.router']);\n        // For Component users, it should look like this:\n        // var myApp = angular.module('myApp', [require('angular-ui-router')]);\n    </script>\n    ...\n</head>\n<body>\n    ...\n</body>\n</html>\n```\n\n### [Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)\n\nThe majority of UI-Router's power is in its ability to nest states & views.\n\n**(1)** First, follow the [setup](#get-started) instructions detailed above.\n\n**(2)** Then, add a [`ui-view` directive](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view) to the `<body />` of your app.\n\n>\n```html\n<!-- index.html -->\n<body>\n    <div ui-view></div>\n    <!-- We'll also add some navigation: -->\n    <a ui-sref=\"state1\">State 1</a>\n    <a ui-sref=\"state2\">State 2</a>\n</body>\n```\n\n**(3)** You'll notice we also added some links with [`ui-sref` directives](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-sref). In addition to managing state transitions, this directive auto-generates the `href` attribute of the `<a />` element it's attached to, if the corresponding state has a URL. Next we'll add some templates. These will plug into the `ui-view` within `index.html`. Notice that they have their own `ui-view` as well! That is the key to nesting states and views.\n\n>\n```html\n<!-- partials/state1.html -->\n<h1>State 1</h1>\n<hr/>\n<a ui-sref=\"state1.list\">Show List</a>\n<div ui-view></div>\n```\n```html\n<!-- partials/state2.html -->\n<h1>State 2</h1>\n<hr/>\n<a ui-sref=\"state2.list\">Show List</a>\n<div ui-view></div>\n```\n\n**(4)** Next, we'll add some child templates. *These* will get plugged into the `ui-view` of their parent state templates.\n\n>\n```html\n<!-- partials/state1.list.html -->\n<h3>List of State 1 Items</h3>\n<ul>\n  <li ng-repeat=\"item in items\">{{ item }}</li>\n</ul>\n```\n\n>\n```html\n<!-- partials/state2.list.html -->\n<h3>List of State 2 Things</h3>\n<ul>\n  <li ng-repeat=\"thing in things\">{{ thing }}</li>\n</ul>\n```\n\n**(5)** Finally, we'll wire it all up with `$stateProvider`. Set up your states in the module config, as in the following:\n\n\n>\n```javascript\nmyApp.config(function($stateProvider, $urlRouterProvider) {\n  //\n  // For any unmatched url, redirect to /state1\n  $urlRouterProvider.otherwise(\"/state1\");\n  //\n  // Now set up the states\n  $stateProvider\n    .state('state1', {\n      url: \"/state1\",\n      templateUrl: \"partials/state1.html\"\n    })\n    .state('state1.list', {\n      url: \"/list\",\n      templateUrl: \"partials/state1.list.html\",\n      controller: function($scope) {\n        $scope.items = [\"A\", \"List\", \"Of\", \"Items\"];\n      }\n    })\n    .state('state2', {\n      url: \"/state2\",\n      templateUrl: \"partials/state2.html\"\n    })\n    .state('state2.list', {\n      url: \"/list\",\n      templateUrl: \"partials/state2.list.html\",\n      controller: function($scope) {\n        $scope.things = [\"A\", \"Set\", \"Of\", \"Things\"];\n      }\n    });\n});\n```\n\n**(6)** See this quick start example in action.\n>**[Go to Quick Start Plunker for Nested States & Views](http://plnkr.co/edit/u18KQc?p=preview)**\n\n**(7)** This only scratches the surface\n>**[Dive Deeper!](https://github.com/angular-ui/ui-router/wiki)**\n\n\n### [Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)\n\nAnother great feature is the ability to have multiple `ui-view`s view per template.\n\n**Pro Tip:** *While multiple parallel views are a powerful feature, you'll often be able to manage your\ninterfaces more effectively by nesting your views, and pairing those views with nested states.*\n\n**(1)** Follow the [setup](#get-started) instructions detailed above.\n\n**(2)** Add one or more `ui-view` to your app, give them names.\n>\n```html\n<!-- index.html -->\n<body>\n    <div ui-view=\"viewA\"></div>\n    <div ui-view=\"viewB\"></div>\n    <!-- Also a way to navigate -->\n    <a ui-sref=\"route1\">Route 1</a>\n    <a ui-sref=\"route2\">Route 2</a>\n</body>\n```\n\n**(3)** Set up your states in the module config:\n>\n```javascript\nmyApp.config(function($stateProvider) {\n  $stateProvider\n    .state('index', {\n      url: \"\",\n      views: {\n        \"viewA\": { template: \"index.viewA\" },\n        \"viewB\": { template: \"index.viewB\" }\n      }\n    })\n    .state('route1', {\n      url: \"/route1\",\n      views: {\n        \"viewA\": { template: \"route1.viewA\" },\n        \"viewB\": { template: \"route1.viewB\" }\n      }\n    })\n    .state('route2', {\n      url: \"/route2\",\n      views: {\n        \"viewA\": { template: \"route2.viewA\" },\n        \"viewB\": { template: \"route2.viewB\" }\n      }\n    })\n});\n```\n\n**(4)** See this quick start example in action.\n>**[Go to Quick Start Plunker for Multiple & Named Views](http://plnkr.co/edit/SDOcGS?p=preview)**\n\n\n## Resources\n\n* [In-Depth Guide](https://github.com/angular-ui/ui-router/wiki)\n* [API Reference](http://angular-ui.github.io/ui-router/site)\n* [Sample App](http://angular-ui.github.com/ui-router/sample/) ([Source](https://github.com/angular-ui/ui-router/tree/gh-pages/sample))\n* [FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions)\n* [Slides comparing ngRoute to ui-router](http://slid.es/timkindberg/ui-router#/)\n* [UI-Router Extras / Addons](http://christopherthielen.github.io/ui-router-extras/#/home) (@christopherthielen)\n \n### Videos\n\n* [Introduction Video](https://egghead.io/lessons/angularjs-introduction-ui-router) (egghead.io)\n* [Tim Kindberg on Angular UI-Router](https://www.youtube.com/watch?v=lBqiZSemrqg)\n* [Activating States](https://egghead.io/lessons/angularjs-ui-router-activating-states) (egghead.io)\n* [Learn Angular.js using UI-Router](http://youtu.be/QETUuZ27N0w) (LearnCode.academy)\n\n\n\n## Reporting issues and Contributing\n\nPlease read our [Contributor guidelines](CONTRIBUTING.md) before reporting an issue or creating a pull request.\n","versions":{"1.0.0-alpha0":{"name":"ui-router","description":"State-based routing for AngularJS","version":"1.0.0-alpha0","homepage":"http://angular-ui.github.com/","contributors":[{"name":"Nate Abele","email":"nate@radify.io","url":"https://radify.io"},{"name":"Chris Thielen","url":"https://github.com/christopherthielen"},{"name":"Chris Thielen","email":"christhielen@gmail.com","url":"https://github.com/christopherthielen"},{"name":"Tim Kindberg","url":"https://github.com/timkindberg"},{"name":"Karsten Sperling","url":"https://github.com/ksperling"}],"maintainers":[{"name":"jesscold","email":"jess@cold.co"}],"repository":{"type":"git","url":"git+https://github.com/angular-ui/ui-router.git"},"bugs":{"url":"https://github.com/angular-ui/ui-router/issues"},"license":"MIT","licenses":[{"type":"MIT","url":"https://github.com/angular-ui/ui-router/blob/master/LICENSE"}],"dependencies":{"angular":"^1.2"},"devDependencies":{"angular2":"^2.0.0-beta.1","babel-core":"^5.8.14","es6-module-loader":"^0.17.3","es6-promise":"^3.0.2","es6-shim":"^0.33.13","faithful-exec":"~0.1.0","grunt":"~0.4.1","grunt-contrib-clean":"~0.5.0","grunt-contrib-connect":"~0.7.1","grunt-contrib-uglify":"~0.4.0","grunt-contrib-watch":"~0.5.3","grunt-conventional-changelog":"~1.1.0","grunt-karma":"~0.11.2","grunt-ngdocs":"~0.1.7","grunt-shell":"^1.1.2","grunt-ts":"^5.2.0","grunt-webpack":"^1.0.10","jasmine-core":"~2.3.4","jsdoc":"git://github.com/jsdoc3/jsdoc.git#v3.2.2","karma":"~0.12.0","karma-chrome-launcher":"~0.1.0","karma-jasmine":"~0.3.6","karma-phantomjs-launcher":"~0.1.0","karma-script-launcher":"~0.1.0","karma-systemjs":"^0.7.2","load-grunt-tasks":"~0.4.0","phantomjs-polyfill":"0.0.1","reflect-metadata":"=0.1.2","rxjs":"^5.0.0-beta.0","shelljs":"~0.2.6","systemjs":"^0.18.4","tslint":"=2.5.0","typedoc":"git://github.com/christopherthielen/typedoc.git#v0.3-uirouter","typescript":"=1.7.3","webpack":"1.x","webpack-dev-server":"1.x","zone.js":"^0.5.10"},"main":"release/angular-ui-router.js","gitHead":"2a20a96e0f68fc5a30be2ce5d55e7eb0f768369c","_id":"ui-router@1.0.0-alpha0","scripts":{},"_shasum":"f0860f2eef07c06d8920c1edee3f42ca4a14f1d8","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.2.0","_npmUser":{"name":"jesscold","email":"jess@cold.co"},"dist":{"shasum":"f0860f2eef07c06d8920c1edee3f42ca4a14f1d8","tarball":"https://registry.npmjs.org/ui-router/-/ui-router-1.0.0-alpha0.tgz","integrity":"sha512-bOv3enGqIajfgj7wdCsR2Qqdcqlhhbagg/jDb+dE6nWhd/JAZbeU+JZ7si9Rck+7HSjY7GfAf+E9rfmczQyLYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEaxpmioChyqP9yFFo/YqQSrOENZy5f+y32VlD2NfMhFAiEAm8dof6QAx7Uw4+2OwD8+IrtOAewjP/rbsGJvnpfzu9Q="}]},"_npmOperationalInternal":{"host":"packages-5-east.internal.npmjs.com","tmp":"tmp/ui-router-1.0.0-alpha0.tgz_1456722169319_0.8758562188595533"}},"1.0.0-alpha.3":{"name":"ui-router","description":"State-based routing for Javascript","version":"1.0.0-alpha.3","scripts":{},"homepage":"http://angular-ui.github.com/ui-router","contributors":[{"name":"Nate Abele","email":"nate@radify.io","url":"https://radify.io"},{"name":"Chris Thielen","url":"https://github.com/christopherthielen"},{"name":"Tim Kindberg","url":"https://github.com/timkindberg"},{"name":"Karsten Sperling","url":"https://github.com/ksperling"}],"maintainers":[{"name":"jesscold","email":"jess@cold.co"}],"repository":{"type":"git","url":"git+https://github.com/angular-ui/ui-router.git"},"bugs":{"url":"https://github.com/angular-ui/ui-router/issues"},"engines":{"node":">4"},"license":"MIT","devDependencies":{"angular2":"^2.0.0-beta.13","babel-core":"^5.8.14","conventional-changelog":"^1.1.0","conventional-changelog-cli":"^1.1.1","es6-module-loader":"^0.17.3","es6-promise":"^3.0.2","es6-shim":"^0.35.0","faithful-exec":"~0.1.0","grunt":"~0.4.1","grunt-contrib-clean":"~0.5.0","grunt-contrib-connect":"~0.7.1","grunt-contrib-uglify":"~0.4.0","grunt-contrib-watch":"~0.5.3","grunt-conventional-changelog":"~1.1.0","grunt-karma":"~0.11.2","grunt-ngdocs":"~0.1.7","grunt-shell":"^1.1.2","grunt-ts":"^5.2.0","grunt-webpack":"^1.0.10","jasmine-core":"~2.3.4","jsdoc":"git://github.com/jsdoc3/jsdoc.git#v3.2.2","karma":"~0.12.0","karma-chrome-launcher":"~0.1.0","karma-jasmine":"^0.3.8","karma-phantomjs-launcher":"~0.1.0","karma-script-launcher":"~0.1.0","karma-systemjs":"^0.7.2","load-grunt-tasks":"~0.4.0","lodash":"^4.5.1","phantomjs-polyfill":"0.0.1","reflect-metadata":"=0.1.2","rxjs":"=5.0.0-beta.2","shelljs":"~0.6.0","systemjs":"^0.18.4","ts-loader":"^0.8.1","tslint":"=2.5.0","typedoc":"git://github.com/christopherthielen/typedoc.git#v0.3-uirouter","typescript":"~1.8.0","webpack":"1.x","webpack-dev-server":"1.x","yargs":"^4.2.0","zone.js":"^0.6.6"},"gitHead":"01577e29c56a108577686f31345b6143b347be3a","_id":"ui-router@1.0.0-alpha.3","_shasum":"b29872720228b09af55259e9418f5e14bc07d962","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"jesscold","email":"jess@cold.co"},"dist":{"shasum":"b29872720228b09af55259e9418f5e14bc07d962","tarball":"https://registry.npmjs.org/ui-router/-/ui-router-1.0.0-alpha.3.tgz","integrity":"sha512-RV2UDj9gaRlHoicUbpJuY5qX8+Tq4OyDVuXpwPlJCa+/lTX98v9AoYT513ieOcvmnl4/sJ4haCmrJPB2Xvarbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA9OnDGWJZlp9yUviQcmVogyWZycc+SkmLRhf3ACGJGJAiBmKMsAjwADn50jyIKUFMH/EWzp/VaBNQOQIAkwL9cBOg=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ui-router-1.0.0-alpha.3.tgz_1460078549666_0.7160020978190005"}}},"homepage":"http://angular-ui.github.com/ui-router","repository":{"type":"git","url":"git+https://github.com/angular-ui/ui-router.git"},"contributors":[{"name":"Nate Abele","email":"nate@radify.io","url":"https://radify.io"},{"name":"Chris Thielen","url":"https://github.com/christopherthielen"},{"name":"Tim Kindberg","url":"https://github.com/timkindberg"},{"name":"Karsten Sperling","url":"https://github.com/ksperling"}],"bugs":{"url":"https://github.com/angular-ui/ui-router/issues"},"license":"MIT","readmeFilename":"README.md","users":{"ajaegle":true,"jens1101":true,"nohomey":true,"stonenik":true}}