は私Plunkerある `ngRepeat'edからのデータを印刷することはできません:https://plnkr.co/edit/rBGQyOpi9lS0QtnCUq4Lはここtextarea`
私は、各textarea
タグで入力されているものconsole.log()
にしたいです。
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)
がどのように私はこのエラーを修正します:
$scope.printStuff= function(customize,item){
console.log(customize[item.index].data);
};
私はどのtextarea
に入力を開始、私はこのエラーを取得:textarea
でのタイピングがprintStuff()
機能をトリガ?私はまだエラーを取得MannFromRenoのANSWER
で更新
。ここに私のPlunkerはあります:
に、あなたはprintStuffにselected.index(番号0)を送信している、とprintStuffの最後の引数はオブジェクトでありますプロパティインデックスを持つ "item" – progysm
@progysmどうすればこの問題を解決できますか?私はまだAngularにはかなり新しいので、何をすべきかはわかりません... – Username