I've been attempting to utilize Angular 1.3 to access a REST service, but I keep encountering an error stating "Error: error:badcfg Response does not match configured parameter".
My suspicion lies in the controller where I invoke $scope.data. Even though I believe .data is correct, it continues to throw this error.
Below is my service code, along with a sample REST call:
var pfcServices = angular.module('pfcServices', ['ngResource'])
pfcServices.factory('pfcArticles', ['$resource',
function($resource){
return $resource('https://myrestcall.com/data, {}, {
query: {method:'GET'}
});
}]);
And here's the snippet of my controller:
var pfcControllers = angular.module('pfcControllers', []);
pfcControllers.controller('pfcCtrl', ['$scope', 'pfcArticles', function ($scope, pfcArticles) {
$scope.data = pfcArticles.query();
}]);
When using Internet Explorer, I receive a CORS message indicating that XMLHttpRequest for necessitates Cross Origin Resource Sharing (CORS). However, this issue doesn't arise in Chrome.
Yet, I'm unsure if this problem is directly related to my implementation or just a mistake on my end. To troubleshoot, I have added my test site to the list of CORS in Azure Mobile Web services where the test REST call is hosted.
Given my limited experience with Angular, I am inclined to think that the error stems from my own misstep.