After loading the page, Angular throws the following error:
angular.js:12520 Error: [$resource:badcfg] http://errors.angularjs.org/1.4.8/$resource/badcfg?p0=query&p1=array&p2=object&p3=GET&p4=%2Fapi%2Fprospects%2Factive
at Error (native)
at http://localhost:3807/Scripts/angular/angular.min.js:6:416
at k.then.p.$resolved (http://localhost:3807/Scripts/angular/angular-resource.min.js:9:408)
at http://localhost:3807/Scripts/angular/angular.min.js:119:129
at r.$eval (http://localhost:3807/Scripts/angular/angular.min.js:133:313)
at r.$digest (http://localhost:3807/Scripts/angular/angular.min.js:130:412)
at r.$apply (http://localhost:3807/Scripts/angular/angular.min.js:134:78)
at g (http://localhost:3807/Scripts/angular/angular.min.js:87:444)
at T (http://localhost:3807/Scripts/angular/angular.min.js:92:50)
at XMLHttpRequest.w.onload (http://localhost:3807/Scripts/angular/angular.min.js:93:78)
The error is likely related to the automatically triggered query
method in the code below:
define(['ngResource'], function () {
'use strict';
prospectResource.$inject = ['$resource'];
return prospectResource;
function prospectResource($resource) {
var controllerPath = '/api/prospects/';
var actions = $resource(controllerPath, {}, {
query: {
method: 'GET',
url: controllerPath + 'active',
isArray: true,
Cache: true
},
all: {
method: 'GET',
url: controllerPath + 'all',
isArray: true,
},
convert: {
method: 'POST',
url: controllerPath + 'convert/:prospectId'
}
});
return actions;
}
});
Interestingly, the error only appears in normal browsing mode in Chrome, not in Incognito. Attempts to clear cache, cookies, and even disabling plugins like Ad-blocker have been unsuccessful in resolving the issue. The question now is, what could be causing this discrepancy? Why does the error persist in normal mode but not in Incognito where everything works smoothly?
The version of Angular in use is 1.4.8