javascript - AngularJS how to change ng-model binding to another element -
how dynamically rebind elements ng-model (change ng-model subject)
for example have
<input type="text" ng-model="info"> <input type="text"> but after user interactions want modify
<input type="text" ng-model="info"> <input type="text" ng-model="info"> or other variables. ideas how dynamically?
then make array.
in controller
$scope.info = []; in html dynamically
<input type="text" ng-model="info[$index]">
Comments
Post a Comment