Answer the question
In order to leave comments, you need to log in
Doesn't work otherwise in $routeProvider?
var app = angular.module('Application', ['ngRoute']);
app.config(function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {
controller: 'MainCtrl',
templateUrl: 'views/app.html'
})
.when('/photo/:id', {
controller: 'PhotoCtrl',
templateUrl: 'views/photo.html'
})
.otherwise({
redirectTo: '/'
});
});
Answer the question
In order to leave comments, you need to log in
I don't use ngRouter, I use ui-router.
Everything seems to be correct with the provider
. It seems to me that the hash tag in the url is missing, it's js, it can only work with them. What will be easy if you go to angular.local?
Enabling html5 mode in Angular is not enough, you also need to configure the server so that it always returns index.html for any link
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question