angular-ui-router
  • Introduction
  • Configuring State
  • Activating State
  • Named Views
  • Nested State
  • onEnter onExit
  • Passing Data
  • Resolve Property
  • State Params
  • State Service
  • State Events
  • Abstract State
Powered by GitBook
On this page
  • Configuration
  • State name
  • stateConfig - object
  • $urlRouterProvider

Was this helpful?

Configuring State

Configuration

angular.module("myApp")
    .config(function($stateProvider, $urlRouterProvider){
        $stateProvider.state(stateName, stateConfig);
    });
- stateName - string
- stateConfig - object

State name

$stateProvider.state('home', {});
$stateProvider.state('home.child', {});
// state() returns $stateProvider
$stateProvider.state('home', {})
    .state("about", {})
    .state("contact", {})

stateConfig - object

template
templateUrl
templateProvider

controller
controllerProvider

resolve
url
params
views
abstract

onEnter ( state )
onExit ( state )

reloadOnSearch // on query parameter change state woun't reload
data

$urlRouterProvider

$urlRouterProvider.when(fromPath, toPath);
$urlRouterProvider.otherwise(path);
$urlRouterProvider.rule(handler)
// handler should return dynamically constructed path string
PreviousIntroductionNextActivating State

Last updated 5 years ago

Was this helpful?