当前位置:Gxlcms > JavaScript > ng-repeat出来的数据怎么取到对应修改值?

ng-repeat出来的数据怎么取到对应修改值?

时间:2021-07-01 10:21:17 帮助过:6人阅读

接口结构

  1. $scope.DataList = [
  2. {
  3. "dataA":"numA",
  4. "dataB":"numB"a
  5. },{
  6. "dataA":"numA",
  7. "dataB":"numB"
  8. },{
  9. "dataA":"numA",
  10. "dataB":"numB"
  11. }
  12. ]

html

  1. <ul><li ng-repeat="item in DataList"><span>{{item.dataA}}</span> //显示字段 dataA<input type="text" ng-model="{{item.dataB}}"></input> //操作 dataB 这个字段</li><ul>

js

  1. $scope.DataList; //直接提交这个数组就可以了

以上就是ng-repeat出来的数据怎么取到对应修改值?的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行