Tengo todo mi proyecto y no me muestra los datos los datos que agregue en mi modelo en la imagen me muestra de esa manera {{}}
CONTROLADOR
public JsonResult GetEmployees() { List<Employee> empList = new List<Employee>(); Employee emp = new Employee { FirstName = "James", LastName = "Bond", Country = "Germany" }; empList.Add(emp); emp = new Employee { FirstName = "Roy", LastName = "Agasthyan", Country = "United States" }; empList.Add(emp); return Json(new { employees = empList }); }
MODELO:
public class Employee { public string FirstName { get; set; } public string LastName { get; set; } public string Country { get; set; } }
VISTA:
<head> <script src="~/Scripts/bootstrap.min.js"></script> <script src="~/Scripts/angular.js"></script> <script src="~/Scripts/jquery-3.1.1.slim.min.js"></script> <script type="text/javascript" src="../Scripts/jquery-1.3.2.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <script type="text/javascript"> var app = angular.module('myApp', []); app.controller('HomeCtrl', ['$ scope', function ($ scope) { $ scope.message = "Welcome to Angular .NET MVC 4"; }]); $ http({ method: 'POST', url: 'Home/GetEmployees' }) .then(function (response) { $ scope.employees = response.data.employees; }, function (error) { console.log(error); }); </script> </head> <body> <div ng-app="myApp" ng-controller="HomeCtrl"> <h2> {{message}} </h2> </div> <hr /> <div ng-app="myApp" ng-controller="HomeCtrl" class="container"> <div class="row"> <div class="bs-example marginTop50" data-example-id="table-within-panel"> <div class="panel panel-default"> <div class="panel-heading"> <h3>Code Handbook</h3> </div> <div class="panel-body"> <p> AngularJS ASP.NET MVC Editable Grid Demo </p> </div> <table class="table"> <thead> <tr> <th> # </th> <th> First Name </th> <th> Last Name </th> <th> Country </th> <th> </th> </tr> </thead> <tbody> <tr ng-repeat="emp in employees"> <th scope="row"> {{$ index+1}} </th> <td> {{emp.FirstName}} </td> <td> {{emp.LastName}} </td> <td> {{emp.Country}} </td> <td> <span class="glyphicon glyphicon-pencil"></span> </td> </tr> </tbody> </table> </div> </div> </div> </div> </body>