I am trying to fetch records via ajax and displaying using AngularJS. But my code even not invoking controller action.
I am trying this code..
<div ng-controller="MyCtrl">
<div ng-repeat="result in products">
{{result.ProductName}}
</div>
</div>
Ajax :
function MyCtrl($scope) {
$.ajax({
url: "/Products/Get/",
type: "POST",
success: function (data) {
// Success message
var myApp = angular.module('myApp', []);
$scope.products = data;
},
error: function () {
// Fail message
},
});
}
I am using this post to make it work.
MyCtrl
– HappyCoding Jul 24 at 11:01