mirror of
https://github.com/wahyd4/Libr-mobile.git
synced 2026-08-09 04:45:57 +10:00
13 lines
681 B
JavaScript
13 lines
681 B
JavaScript
// Make sure to include the `ui.router` module as a dependency
|
|
angular.module('uiRouterSample', ['ui.router'])
|
|
.run(
|
|
[ '$rootScope', '$state', '$stateParams',
|
|
function ($rootScope, $state, $stateParams) {
|
|
|
|
// It's very handy to add references to $state and $stateParams to the $rootScope
|
|
// so that you can access them from any scope within your applications.For example,
|
|
// <li ng-class="{ active: $state.includes('contacts.list') }"> will set the <li>
|
|
// to active whenever 'contacts.list' or one of its decendents is active.
|
|
$rootScope.$state = $state;
|
|
$rootScope.$stateParams = $stateParams;
|
|
}]); |