的index.html
<base href="/" />
RouteConfig
angular.module('DFApp').config(function ($routeProvider, $httpProvider,$locationProvider) {
$routeProvider.when("/Home", {
templateUrl: "../Views/ListofTopicsDiscussed.html",
controller: "ListofTopicsDiscussedController"
})
.when("/ShowParticularTopic", {
templateUrl: "ShowParticularTopic.html",
controller: "ShowParticularTopicController"
})
.when("/Topics/:TopicID", {
templateUrl: "../Views/ShowParticularTopic.html",
controller: "ListofTopicsDiscussedController"
})
.otherwise({ redirectTo: "/Home" });
$locationProvider.html5Mode(true);
});
从主页到主题,我使用此链接进行导航
<a href="Topics/{{topic.TopicID}}">{{topic.TopicName}}</a>
此外,我尝试在我的控制器中添加$ loction.path,这对我没有帮助。请帮我解决这个问题。