Hello, I'm looking for information in a local database with the following code:
var app = angular.module('app',[]);
app.controller('conexao',function($scope, $http){
$scope.names = [];
$http.get('http://localhost/angular/conect/connect.php').then(function successCalback(response){
$scope.names = response.data;
console.log($scope.names);
},
function errorCallback(response){
console.error('Erro ' + response);
});
});
To be displayed here:
<body ng-controller="conexao">
<table>
<tr ng-repeat="x in names">
<td>{{x.nome}}</td>
<td>{{x.idade}}</td>
<td>{{x.cor}}</td>
</tr>
</table>
</body>
But all I get is an empty screen, even though the console returns:
>Object {records: Array[2]}
And this message:
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience.
I want to understand what's going on and how to solve it.