【发布时间】:2016-11-24 18:47:42
【问题描述】:
如何以只能获取 template.html 而不能获取 template1.html 的方式组织以下代码?
App.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
$routeProvider
.when('/', {
templateUrl: "template/home.html",
controller: "homeCtrl"
})
.when('/artist', {
templateUrl: "template/artist.html",
controller: "artistCtrl"
})
.when('/:collectionId', {
templateUrl: "template/template.html",
controller: "templateCtrl"
})
.when('/:trackId', {
templateUrl: "template/template1.html",
controller: "templateCtrl"
})
.otherwise({
redirectTo: "/"
});
}]);
感谢您的帮助!
【问题讨论】:
-
你的问题不清楚
-
使用
'/collection/:id'和'/track/:id'作为路由。
标签: javascript html angularjs templates