I have the following in one of my templates (under a folder name "partials")
<a href="index.html">« Back to search</a>
in one of my js I define the routing in the following way:
var app=angular.module("app",['ngRoute', 'playerControllers']);
app.config(['$routeProvider', function($routeProvider){
$routeProvider.
when('/list',{
templateUrl:'partials/list.html',
controller: 'ListController'
}).
when('/details/:itemId',{
templateUrl:'partials/details.html',
controller: 'DetailsController'
}).
otherwise({
redirectTo: '/list'
});
}]);
For some reason when I click on the back link it doesn't get to http://localhost:63342/mcaabiTLV/app/index.html#/list,则Angular不起作用。相反,它得到了 http://localhost:63342/mcaabiTLV/app/index.html#
答案 0 :(得分:0)
你应该写:
<a href="#/list">« Back to search</a>