我試圖手動構建一個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」不會退出。 此外,我嘗試了不同的pathes爲: templateUrl: 「模板/主/登錄/ login.html的」 templateUrl: 「根目錄/模板/主/登錄/ login.html的」
由URL帶有一個方式「#」(如nameDomain.com/#/login,但它應該是nameDomain.com/#login),但似乎angularjs只允許/ nameUrlTemplate
這有什麼錯我的WHEN。當( '/登錄',{ templateUrl: '../templates/main/login/login.html' }) – Donovant 2015-02-06 10:12:11
另外:我想有/#改爲登錄/#/登錄 – Donovant 2015-02-06 10:44:42