0
<table>
<tr ng-repeat="objective in objectives">
<td>
<p> {{objective.name}} </p>
<table>
<tr ng-repeat="data in getData(objective.id)">
<td> {{data.value}} </td>
</tr>
</table>
</td>
</tr>
</table>
my controller code is ---
objectiveService.getObjective().success(function (data) {
$scope.objectives = data;
$scope.loading = false;
})
.error(function (data) {
$scope.error = "An Error has occured while loading posts! " + data.ExceptionMessage;
$scope.loading = false;
});
$scope.getData = function (id) {
$scope.loading = true;
var currentObjective = id;
objectiveService.getObjectiveById(currentObjective).success(function (data) {
$scope.loading = false;
return data;
}).error(function (data) {
$scope.error = "An Error has occured while Saving Objective! " + data.ExceptionMessage;
$scope.loading = false;
});
};
我在AngularJS工作,以上是我的代碼,我使用的,但這個循環是要無限長的時間,我不明白的地方,我沒有錯,任何人都可以請幫我AngularJS NG-REPEAT循環內NG-重複是那張無限
介意分享js代碼? – doge1ord
可以顯示你的控制器? getData是做什麼的? –
我編輯了這個問題,請檢查 –