javascript - angularJS get value from a textarea inside a ng-repeat -
How do I get inside a .. What's my mistake? textarea
within a ng-repeat
& lt; Div class = "container" ng-repeat = "data data list in data | filter: {sea: season}" & gt; & Lt; Img src = "..//content/catalog/ {{session}} / {{data.id}}" /> & Lt; Div class = "container description" & gt; Desc: & lt; P & gt; & Lt; Textarea ng-model = "textarie [$ index]" style = "height: 120px; width: 200px;" & Gt; {{Data decimation}} & lt; / Textarea & gt; & Lt; / P & gt; & Lt; Div ng-click = "savings (data. Id, $ index)" & gt; Save & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;
$ scope.saveDescription = function (id, count) {description = $ scope.textArea [count] Alert (description)} < / Code>
& lt; Div class = "container" ng-repeat = "data in data list data | filter: {sea: seasons}" & gt; & Lt; Img src = "..//content/catalog/ {{session}} / {{data.id}}" /> & Lt; Div class = "container description" & gt; Desc: & lt; P & gt; & Lt; Textarea ng-model = "textArea" style = "height: 120px; width: 200px;" & Gt; {{Data.description}} & lt; / Textarea & gt; & Lt; / P & gt; & Lt; Div ng-click = "savings (data. Id, $ index, textaria)" & gt; Save & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;
No need to use an array just pass the text to the function as the parameter
$ scope.saveDescription = function (id, count , TextArea) {description = textArea; Warning (description)}
Comments
Post a Comment