What's wrong with this code? I'm trying to run it, but in no way does it show me the data coming from the bank!
var app = angular.module('app', []);
app.controller('clienteController', ['$scope', '$http', clienteController]);
function clienteController($scope, $http) {
$http.get('http://localhost:3091/api/ClientesWebAPI/Getcliente')
.success(function (data) {
$scope.listaclientes = data;
})
.error(function () {
$scope.erro = "Erro: Nao foi possivel carregar.";
});
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h2>Listagem de Clientes</h2>
<div data-ng-controller="clienteController">
<div class="panel panel-default">
<div class="panel-heading">Lista de clientes</div>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
<strong>{{erro}}</strong>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-bordered table-hover">
<tr>
<td>ID</td>
<td>Nome</td>
<td>Email</td>
<td>Idade</td>
<td>Data nascimento</td>
<td>Data cadastro</td>
</tr>
<tr ng-repeat="cliente in listaclientes">
<td>{{ cliente.id_nome }}</td>
<td>{{ cliente.nome }}</td>
<td>{{ cliente.idade }}</td>
<td>{{ cliente.sexo }}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>