Skip to content

Instantly share code, notes, and snippets.

@allyusd
Created August 7, 2014 08:21
Show Gist options
  • Save allyusd/f8fa9854637d1fec947a to your computer and use it in GitHub Desktop.
Save allyusd/f8fa9854637d1fec947a to your computer and use it in GitHub Desktop.
AngularJS - ngRoute - app.js config
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: 'MyCtrl1'});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: 'MyCtrl2'});
$routeProvider.otherwise({redirectTo: '/view1'});
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment