【发布时间】:2014-08-02 13:58:01
【问题描述】:
你能告诉我如何在第二个视图上显示参数的值吗?实际上我制作了一个表单,其中有两个字段:名称和类。当用户按下(填写字段后)添加它在下面生成一行。点击我得到名称和类的值现在我想在下一页显示该名称和值。我们可以显示这个吗?
http://plnkr.co/edit/NSZufLOX7bt52S3fdAXo?p=preview
app.controller("ctrl",['$scope',"$location",function(s,$location){
s.students = [];
s.add = function() {
s.students.push({
inputName : angular.copy(s.inputName),
inputclass : angular.copy(s.inputclass)
});
s.inputclass='';
s.inputName='';
}
s.getListClick=function(name,className){
alert(name+":"+className);
$location.path('/navigation')
}
}])
谢谢
【问题讨论】:
-
你的意思是你有两个参数要发送到你的下一页?
-
如果是这样,你可以使用 $routeParams ,
-
是的..正是.你是对的
-
我认为有办法通过控制器?
-
数据何时在两个控制器之间传递?你能换个plunker吗
标签: javascript jquery angularjs angularjs-directive