I'm building an ASP.NET MVC application with an Angular front-end. I. Successfully call the Angular GetData() function on page load and I've traced to confirm that Home/DataRefresh is returning data in the correct format.
However when I use data to populate a table in the view nothings shows up, no errors, the calls all complete, the table is just empty.
I have a suspicion that it has something to do with how you have to access the Angular $scope within a non-angular function but I'm too new to angularjs to know for sure. I've read through all the documentation I could find to no avail.
EDIT: Per suggestion here's the $http call and the Angular it's contained in.
app.controller("processModel", function ($scope) {
$scope.sortType = 'SchedWk';
$scope.sortReverse = false;
$scope.GetData = function() {
$scope.LoadData();
};
$scope.LoadData = function() {
//$.ajax({
// type: "GET",
// url: 'Home/DataRefresh',
// dataType: "json",
// success: function (data) {
// $scope.data = data;
// },
// error: function (a, b, c) {
// alert("The jqXHR object: " + a + " Error Type: " + b + " Error Description: " + c);
// }
//});
$http({
method: "GET",
url: '/Home/DataRefresh'
}).then(function success(data) {
$scope.data = data;
}, function error(errResponse) {
alert("y u break it tho");
});
};
});