Я использую AngularJS, и я не могу заполнить данные в index.view с помощью ng-repeat of angular.
Я оставлю фрагмент кода для любой помощи.
Помните, у меня есть статус запросов http 200 в порядке, просто когда я подключаю данные на экране, я не могу заполнить.
registerController.js
angular.module('Application').controller('registerController',
function($scope,
$http, registerService) {
$scope.registerUser = {};
$scope.GetAllRegisters = function () {
var registerServiceCall = registerService.GetRegisters();
registerServiceCall.then(function (results) {
$scope.registers = results.data;
}, function (error) {
$log.error('ERRO');
});
};
$scope.GetAllRegisters();
});
Мой сервис.js
angular.module('Application').factory('registerService', function ($http) {
return {
GetRegisters: function () {
return $http({
method: 'Get',
url: "http://localhost:51734/api/UserAPI"
})
},
};
});
И мой index.html
<div class="row" style="">
<table class="table table-striped" style="">
<tbody>
<tr>
<th style="display:none">Id</th>
<th>Nome</th>
<th>Sobrenome</th>
<th>Ativo</th>
<th>Email</th>
<th>Editar</th>
<th>Remover</th>
</tr>
<tr ng-repeat="registerUser in registers" style="word-wrap: break-word;">
<td style="display:none">{{registerUser.UserId}}</td>
<td>{{registerUser.Name}}</td>
<td>{{registerUser.LastName}}</td>
<td><input type="checkbox" ng-model="registerUser.IsActive" disabled /></td>
<td>{{registerUser.Email}}</td>
<td>
<a href="" ng-click="" class="glyphicon glyphicon-edit"></a>
<td>
<a href="" ng-click="" class="glyphicon glyphicon-trash"></a>
</td>
</tr>
</tbody>
</table>
Буду признателен за любую помощь или совет. Спасибо