A portion of my code involves a service module that sends data using the POST method:
//services.js
var myServices = angular.module('myServices', ['ngResource']);
myServices.factory('User', ['$resource', function($resource){
return $resource('/signup');
}]);
Here is the relevant controller:
//controllers.js
var myControllers = angular.module('myControllers', []);
myControllers.controller('UserController', ['$scope', 'User', function($scope, User) {
$scope.register = function() {
User.save($scope.user);
$scope.user = "";
alert("User Added"); //for testing
};
}]);
Although the form data for user registration is successfully posted and my nodejs server sends a response, there is an error displayed in the console once the process is complete:
Error: [$resource:badcfg] object - http://errors.angularjs.org/1.2.12/$resource/badcfg?p0=array
If anyone can provide assistance, it would be greatly appreciated.