在AngularJS中,当用户选择时,如何将值从select字段设置为textarea字段。
<div class="controls" ng-controller = "TemplateCtrl">
<select ng-model = "template" ng-options="template.fname for template in templates">
<option value="">-- choose template --</option>
</select>
Currently selected: {{ {selected_template:template} }}
</div>
有人可以帮助我。
答案 0 :(得分:0)
<强> HTML 强>
<div ng-controller = "fessCntrl">
<select ng-model = "template" ng-options="template.fname as template.fname for template in templates">
<option value="">-- choose template --</option>
</select>
Currently selected: {{ template }}
</div>
<强> JS 强>
$scope.templates =[
{'fname':'hello there1'},
{'fname':'hello there2'},
{'fname':'hello there3'}
];
演示Fiddle