【发布时间】:2015-12-19 00:00:14
【问题描述】:
我正在使用 API 通过$http 填充$scope.var,并采用$scope.var。
我有一个嵌套的ng-repeat
html:
<tr ng-repeat='(chore,details) in choreList'>
<td>
<div class="btn-group">
<button ng-repeat="user in users" class='btn group-item' ng-click="addChoreDetail(chore, user.name)" title="{{user.name}}" ng-disabled="checkAddabilityChoreDetail(chore, user.name)">{{chore}}</button>
</div>
</td>
</tr>
js:
$scope.checkAddabilityChoreDetail = function(inputChore,inputName){
console.log(inputChore);
}
我不知道在 Angular 中如何让 ngDisabled 等待发送杂项变量,直到重复实际发生。
我在控制台日志中收到 get choreList 的请求时间的 undefined,但我不确定如何让它等待我的对象填充数据。
【问题讨论】:
-
“家务”从何而来?
-
你有 ng-repeat 从 $scope.choreList 和 $scope.users 获取你的数组。确保您通过 API 填充这些范围变量...
标签: javascript angularjs