Skip to content

Instantly share code, notes, and snippets.

@johnhiott
Created December 9, 2013 10:18
Show Gist options
  • Save johnhiott/7870110 to your computer and use it in GitHub Desktop.
Save johnhiott/7870110 to your computer and use it in GitHub Desktop.
Enable AngularJS HTML5 Urls
var app = angular.module('johnhiott', []).
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
//ADD THIS LINE
$locationProvider.html5Mode(true);
$routeProvider.
when('/home', {templateUrl: 'partials/home.html', controller: homeCtrl}).
when('/projects', {templateUrl: 'partials/projects.html', controller: projectsCtrl}).
when('/stats', {templateUrl: 'partials/stats.html', controller: statsCtrl}).
when('/resume', {templateUrl: 'partials/resume.html', controller: resumeCtrl}).
otherwise({redirectTo: '/home'});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment