function ContactDetails($scope, $http) {
$http({
method: 'GET',
url: 'myurl/?',
params: { 'company': '1571', 'secret': 'complex15', 'mode': 'contactdetails', 'outputtype': 'json' }
}).success(function (data) {
alert(data);
$scope.ContactInfo = data;
}).error(function (data, status) {
$scope.status = status;
alert('Error fetching contact details');
});
}
When accessing the URL directly from a browser, it returns a JSON string. However, when using the code above, an error is encountered. I am still learning AngularJS and would appreciate some guidance. Thank you.