Query from AngularJS beginner:
I'm new to AngularJS and I'm attempting to utilize an asmx web service to display a grid. I have tested the web service and it correctly outputs the JSON data. Below is my controller code:
app.controller('SetupController', ['$scope', '$http', function ($scope, $http) {
var url = 'app/pricefilessetup/grid.asmx/getGridJson';
$http.get(url).success(function (data) {
var myjson = JSON.parse(data);
$scope.products= JSON.parse(myjson);
});
}]);
Unfortunately, I am unable to paste HTML code here due to some restrictions, but it includes ng-controller directive and ng-repeat loop for parsing through the JSON data.
Upon running the application, I encounter the following error:
SyntaxError: Unexpected token o at Object.parse (native) and it points to the line below:
$scope.questions = JSON.parse(myjson);
I attempted to check the value of myjson using alert and it displays [object Object], [object Object], ...
Is there something that I might be overlooking?