javascript - dropdown and textarea binding with AngularJS -
i have simple scenario , wanted use angularjs that. not able 1 right.
i retrieving data database , directly writing view inside dropdown. based on item selected, want populate value textbook.
so code follows:
<select> <option selected="selected" disabled="disabled">dropdown</option> @foreach (system.data.datarow row in viewbag.template.rows) { <option value="@row[1].tostring()">@row[0].tostring()</option> } </select> <textarea></textarea>
i trying achieve following:
whatever option user select, corresponding value item populated text area.
please suggest how can achieve using angularjs.
you should use ngmodel
directive that, same both select , textarea:
<select ng-model="selectmodel"> <option selected="selected" disabled="disabled">dropdown</option> @foreach (system.data.datarow row in viewbag.template.rows) { <option value="@row[1].tostring()">@row[0].tostring()</option> } </select> <textarea ng-model="selectmodel"></textarea>
Comments
Post a Comment