I have the following code that through a controller brings me an object $resource
, those values can not be shown in the view, the code is as follows:
1- The model
'use strict';
(function (){
'use strict'
angular
.module('crud')
.factory('UsuarioModel',function($resource){
return $resource('http://localhost/crud/laravel/index.php/',{},
{
update:{method:'PUT'}
}
);
})();
2- The Controller
(function() {
'use strict';
function UsuarioController($scope, UsuarioModel){
var scope=this;
scope.usuarios=UsuarioModel.get({"start":0,"limit":10});
console.log(scope.usuarios);
}
angular.module('crud')
.controller('UsuarioController', UsuarioController, ['$scope']);
})();
this is what the console shows me:
3.- This is the view
<tbody ng-repeat=" usuario in usuarios | filter: buscador">
<td>{{ usuario.nombre_usuario}}</td>
<td>{{ usuario.login_usuario }}</td>
<td>{{ usuario.password_usuario }}</td>
<td>{{ usuario.email_usuario }}</td>
<td>{{ usuario.telefono_usuario }}</td>
<td><a href="#/info/{{id}}"><button class="btn btn-primary" type="button">Ver</button></a></td>
<td><a ui-sref="edit({id})"><button class="btn btn-info" type="button">Editar</button></a></td>
<td><a href="#/remove/{{id}}"><button class="btn btn-danger" type="button">Eliminar</button></a></td>
</tbody>
Any suggestions on how to display the array values?