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