1
resposta

Ng repeat nao exibe os dados ANGULARJS

Eu faço uma requisição via get utilizando laravel como backend. Ele retorna os dados, consigo exibir no console.log, porem nao consigo exibir no ng-repeat

Segue todo meu front-end

<!DOCTYPE html>
<html ng-app="myApp">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body>


<div ng-controller="myCtrl">
    <tr ng-repeat="t in teste">
        <td>{{t.id}}</td>
        <td>{{t.total}}</td>
    </tr>    
</div>


<script>


var app = angular.module('myApp', []);

app.controller('myCtrl', function($scope, $http) {
  $http.get("//localhost:8000/angular")
  .then(function(response) {        
      $scope.teste = response.data;
      console.log($scope.teste);



  });
});
</script>

</body>
</html>
1 resposta

Olá, Felipe!

Faça o seguinte: coloque um <table> e um </table> envolvendo esse <tr>.

O AngularJS é meio rigoroso com a estrutura do HTML, por incrível que pareça!