search

Home  >  Q&A  >  body text

angular.js - The ng-repeat directive in angularjs loops out 10 input tags. How to limit the input to only numbers?

As the title says, limit the input to only numbers, and finally get the values ​​of all inputs

<p ng-repeat='item in data'>
    <input type='text' value='{{item.name}}'>
</p>

My original method was to use native javascript to operate. Although it can also solve the problem, it is not ideal. I am looking for some ideas

伊谢尔伦伊谢尔伦2822 days ago867

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-05-15 17:04:22

    directive

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-15 17:04:22

    <p ng-repeat='item in data'>
        <input type='number' ng-model='item.name'>
    </p>

    reply
    0
  • Cancelreply