0
這是我的角度的應用程序文件,其中添加我的路由:角航線找不到觀點
(function() {
var app = angular.module("CustCMS", ["ngRoute"]);
app.config(function ($routeProvider) {
$routeProvider
.when("/Index", {
templateUrl: "~/CustCMS/Views/User/Index.html",
controller: "IndexController"
})
.when("/User/:userid", {
templateUrl: "~/CustCMS/Views/User/User.html",
controller: "UserController"
})
.otherwise({ redirectTo: "/Index" });
});
}());
我已經嘗試了一些不同的方式進入templateUrl但我總是得到這個錯誤:
[$compile:tpload] Failed to load template: ~/CustCMS/Views/User/Index.html (HTTP status: 404 Not Found)
我有什麼進入了templateUrl找到我的看法?
你嘗試過'templateUrl:「/Views/User/Index.html」,'? – webduvet
是的。我dosn't工作要麼:( –