AngularJS ng-repeat does not display data

0

I made the request via get using laravel as backend. However, if I update some data in the database itself, I need to refresh the page where the angular is loaded for it to update. Using the angle, would not it have to update automatically?

<!DOCTYPE html>
<html ng-app="myApp">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script><body><divng-controller="myCtrl">
<table>
    <tr ng-repeat="t in teste">
        <td>{{t.id}}</td>
        <td>{{t.total}}</td>
    </tr>
</table>    
</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>
    
asked by anonymous 30.05.2018 / 23:30

0 answers