After reading a ton of write-ups and stackoverflow questions on Angular.js route, I\'m still getting the \'Not Found\' error when I do a manual refresh.
Steps:
I don't know if this is the optimal solution, but I did find a combination of settings that worked:
hashPrefix('!')
(see below)
in my index.htmlFallbackResource /index.html
to my
section in my server .conf
file per this post. After setting this, it didn't seem to matter what the local mod_rewrite
settings were.// Routing configuration.
angular.module('myModule')
.config(['$routeProvider', '$locationProvider',
function ($routeProvider, $locationProvider) {
// Enable pushState in routes.
$locationProvider.html5Mode(true).hashPrefix('!');
$routeProvider
.when('/home', {
templates: {
layout: '/views/home.html'
},
title: 'Welcome!'
})
.when('/launchpad', {
templates: {
layout: '/views/layouts/default.html',
content: '/views/partials/profile.html'
},
title: "Launchpad"
})
.otherwise({
redirectTo: '/home'
});
}
]);