miércoles, 19 de septiembre de 2018

object object print html

HTML:

< div class="row" >
    < div class="form-group col-lg-6 col-md-6" >
        < table class="resultados table table-striped" >
     < tr >
                < th >Id< /th >
                < th >PrimerNombre< /th >
                < th >SegundoNombre< /th >
                < th >PrimerApellido< /th >
            < /tr >
            < tr ng-repeat="row in listaPersonas.data" >
                < td >{{row.id}}< /td >
                < td >{{row.primerNombre}}< /td >
                < td >{{row.segundoNombre}}< /td >
                < td >{{row.primerApellido}}< /td >
                                 
            < /tr >
        < /table >

    < /div >
< /div >


JS:

 $scope.buscarTodasPersonas = function () {
  $http.get('./rest/hi3/buscarTodasPersonas', {})
        .then(function (response, status, headers, config){
        $scope.listaPersonas = response;
            console.log("Object: ", JSON.parse(JSON.stringify(response)));
            console.log(response);
            alert(response.toSource());

        },function (error){
   alert('Error al consultar la informaci\xf3n, por favor intente m\xe1s tarde');
   });     
    };
    $scope.buscarTodasPersonas();
    

No hay comentarios: