Created
August 7, 2014 08:23
-
-
Save allyusd/5adf39fcb4efddf47c38 to your computer and use it in GitHub Desktop.
AngularJS - ui-router - app.js config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { | |
// | |
// For any unmatched url, redirect to | |
$urlRouterProvider.otherwise("/main"); | |
// | |
// Now set up the states | |
$stateProvider | |
.state('main', { | |
url: "/main", | |
templateUrl: "partials/main.html" | |
}) | |
.state('main.view1', { | |
url: "/view1", | |
templateUrl: "partials/partial1.html", | |
controller: "MyCtrl1" | |
}) | |
.state('main.view2', { | |
url: "/view2", | |
templateUrl: "partials/partial2.html", | |
controller: "MyCtrl2" | |
}); | |
}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment