search

Home  >  Q&A  >  body text

angular.js - angularjs define variable name

If you want to bind ng-model cyclically, how can you ensure that the names of ng-model are different?

迷茫迷茫2846 days ago580

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-15 17:08:37

    Use an array

    <p ng-repeat="item in arr">
        <input ng-model="inputs[$index]">
    </p>

    There is $scope.inputs array

    reply
    0
  • Cancelreply