-via**[jspm](http://jspm.io/)**: by running `$ jspm install angular-ui-router` from your console
-orvia**[npm](https://www.npmjs.org/)**: by running `$ npm install angular-ui-router` from your console
-orvia**[Bower](http://bower.io/)**: by running `$ bower install angular-ui-router` from your console
-orvia**[Component](https://github.com/component/component)**: by running `$ component install angular-ui/ui-router` from your console
**(2)**Include`angular-ui-router.js` (or `angular-ui-router.min.js`) in your `index.html`,afterincludingAngularitself(ForComponentusers:ignorethisstep)
**(3)**Add`'ui.router'` to your main module's list of dependencies (For Component users: replace `'ui.router'` with `require('angular-ui-router')`)
**(2)**Then,adda[`ui-view` directive](https://github.com/angular-ui/ui-router/wiki/Quick-Reference#ui-view) to the `<body />`ofyourapp.
>
```html
<!--index.html-->
<body>
<divui-view></div>
<!--We'llalsoaddsomenavigation:-->
<aui-sref="state1">State1</a>
<aui-sref="state2">State2</a>
</body>
```
**(3)**You'llnoticewealsoaddedsomelinkswith[`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`aswell!Thatisthekeytonestingstatesandviews.