在select的ng-model中我想实现ng-model="12345+week.text",也就是说一个字符串加遍历repeat对象的某个属性值,来实现ng-model唯一性该怎么写呢?
1条回答 默认 最新
qq_24581629 2017-04-07 06:30关注以下代码可以实现ng-model命名拼接
html: <div ng-repeat='week in [{text:"ss"},{text:"aa"},{text:"zz"}]'> <select ng-model='$parent[i.text+1234]'> <option value="John">John11</option> </select> </div> js: $scope.ss1234="John"本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报