0
我想訪問javascript變量,然後在控制器中更改它,然後在路由中使用它..但它顯示的是同一個舊的。在angularjs中訪問javascript變量
var userEditid = 0;
app.controller("cn_newuser", function ($scope,$window) {
editUser = function (this_) {
$window.userEditid = this_.firstElementChild.value;
alert(userEditid);
//window.location.path("#/edit_user");
//$window.location.href = "#/edit_user";
}
中的Abobe路線userEditid路線
.when("/edit_user", {
templateUrl: "/master/edituser/" + userEditid //userEditid should be 3 or some thing else but is showing 0
})
應該是3或者一些別的東西,但正顯示出0
謝謝...我是新來的角...你可以告訴我什麼是服務代碼\ – user2601893 2014-11-21 06:20:23
是的,你有一個小提琴的地方? – deitch 2014-11-21 06:36:06
不要太難過;角度是神話般的,但學習曲線陡峭,教程是可怕的。但越來越多,每天上網。 – deitch 2014-11-21 06:39:22