Use*_*ame 7 html javascript angularjs
这是我的Plunker:https://plnkr.co/edit/rBGQyOpi9lS0QtnCUq4L
我想要console.log()在每个textarea标签中输入的内容.键入一个textarea触发printStuff()函数:
$scope.printStuff= function(customize,item){
console.log(customize[item.index].data);
};
Run Code Online (Sandbox Code Playgroud)
当我开始输入任何内容时textarea,我收到此错误:
angular.js:14290 TypeError: Cannot read property 'data' of undefined
at b.$scope.printStuff (index.html:31)
at fn (eval at compile (angular.js:15118), <anonymous>:4:299)
at b.$eval (angular.js:17922)
at angular.js:25653
at Object.<anonymous> (angular.js:28429)
at q (angular.js:325)
at Object.$$writeModelToScope (angular.js:28427)
at angular.js:28420
at g (angular.js:28339)
at f (angular.js:28322)
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个错误?
更新了MannFromReno的答案
我仍然得到错误.这是我的Plunker:https://plnkr.co/edit/WwC3kNiTQzaQfjp40h2a
| 归档时间: |
|
| 查看次数: |
264 次 |
| 最近记录: |