angularjs - Add textarea control dynamically in Angular JS -
Please help me at the need with angle JS code below,
The ADD button should be, when we click on ADD, I should add texture controls. I should be able to add unlimited number of texture controls by clicking on this ADD button.
You can do this. This is the easiest way: plunker
html:
& lt; Div ng-repeat = "textArea in textAreas" & gt; & Lt; Textarea id = "maxlength_textarea" class = "form-control" maxlength = "225" rows = "2" ng-model = "textA.textbox" placeholder = "text box" & gt; & Lt; / Textarea & gt; & Lt; / Div & gt; & Lt; Button class = "btn btn-info" ng-click = "additional ()" & gt; Add more & lt; / Button & gt; In the admin
:
$ scope.textAreas = []; $ Scope.addMore = function () {$ scope.textAreas.push ({textBox: ""}}}}
Comments
Post a Comment