-1
请帮我设置路由角度...设置角度的路由
当没有$ location.path()index.html和MainController必须加载。 当$ location.path()= @ *时,其中*任何对象的名称都必须加载index2.html和myController。
现在它不工作:
app.config(function ($routeProvider) {
$routeProvider
.when("/", {
templateUrl: "index.html",
controller: "MainController"
})
.when("/@*", {
templateUrl: "index2.html",
controller: "myController"
});
});
当我试图直接打开'url.com/@ object' ...有 “不能GET/@对象”,我究竟做错了什么? – Daryushka
正确我看,问题是你不是URL编码的字符串。你不能在URL中使用'@'。如果需要的话,你必须按照[这里](http://www.w3schools.com/tags/ref_urlencode.asp)的解释将它编码为“%40” –