SCRIPT DEL JS
var conductores = angular.module('conductores', []);
conductores.controller('ConductorsController', function ($scope, $http) {
$http.get('/Conductors/Index').then(function (response) {
$scope.lista = response.data;
})
})
HTML
@model IEnumerable<ajax_test.Conductor>
@{
ViewBag.Title = "Index";
}
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div ng-app="conductores" ng-controller="ConductorsController"></div>
<div class="row">
<div class="col" s6>
<h2>Conductores</h2>
</div>
<table class="table">
<tr>
<th>
Nombre
</th>
<th>
Apellido
</th>
<th>
Direccion
</th>
<th>
Cedula
</th>
<th>
Telefono
</th>
</tr>
<tr ng-repeat="conductor in lista">
<td>
{{conductor.Nombre}}
</td>
<td>
{{conductor.Apellido}}
</td>
<td>
{{conductor.Direccion}}
</td>
<td>
{{conductor.Cedula}}
</td>
<td>
{{conductor.Telefono}}
</td>
</tr>
</table>
</div>