【发布时间】:2015-02-05 17:43:57
【问题描述】:
我正在尝试手动构建一个 shell 试图弄清楚它是如何工作的
结构:
- application(php stuff)
- webroot
-- app
--- app.js
-- templates
--- main
---- login
----- login.html
index.html (with angularjs libs)
app.js:
function config($routeProvider){
$routeProvider
.when("/login",{
templateUrl: "../templates/main/login/login.html"
})
.otherwise({ redirectTo:"/other" });
}
angular
.module("app", ["ngRoute", "ngResource"])
.config(config);
登录:
<div>LOGIN test template</div>
"/other" 不退出。 此外,我尝试了不同的路径: 模板网址:“模板/main/login/login.html” templateUrl: "webroot/templates/main/login/login.html"
顺便说一下,url 带有一个“#”(例如 nameDomain.com/#/login,但它应该是 nameDomain.com/#login)但 angularjs 似乎只允许 /nameUrlTemplate
【问题讨论】:
标签: javascript angularjs configuration angularjs-ng-route