Check out my code on Plunker: https://plnkr.co/edit/rBGQyOpi9lS0QtnCUq4L
I'm trying to log the content of each textarea when typing, using the printStuff() function:
$scope.printStuff = function(customize, item) {
console.log(customize[item.index].data);
};
However, I encounter an error message once I start typing in a 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)
Any suggestions on how to resolve this issue?
AFTER FOLLOWING MannFromReno's ADVICE
The error still persists. Here is the updated Plunker link: https://plnkr.co/edit/WwC3kNiTQzaQfjp40h2a