Skip to content

State provider basic configuration

jeme edited this page Apr 4, 2013 · 8 revisions

Configuration of the $stateProvider is very similar to the way the $routeProvider is configured using when, except you use state and the first argument is a name of the state rather than a route.

Here is a very basic example of configuring states.

angular.module('phonecat', ['ui.routing']).
  config(['$stateProvider', function($stateProvider) {
  $stateProvider
      .state('phones', { /*.. Parameters for the state ..*/ })
      .state('tablets', { /*.. Parameters for the state ..*/ });
}]);
Clone this wiki locally