angularjs - Angular Pass Request Body to a Restful Interface -
my restful controller receiving null request body angular post , i'm not sure why.
here's code controller:
admincontroller.controller('modalctrl', ['$scope', '$modal', '$log', 'profile', 'availableprofiles', function ($scope, $modal, $log, profile, availableprofiles) { $scope.open = function (uuid, profile) { var modalinstance = $modal.open({ animation: true, templateurl: 'mymodalcontent.html', controller: 'modalinstancectrl', resolve: { profile: function () { return profile; }, availableprofiles: function () { return availableprofiles; } } }); modalinstance.result.then(function () { profile.save({uuid: uuid}, {profile: profile}); }, function () {}); }; }]);
and here's code service:
adminservice.factory('profile', ['$resource', function($resource, uuid, profile) { return $resource(baseurl + 'candidate/:uuid/profile', {profile}, { save: {method: 'post', params: {uuid: uuid}}, }); } ]);
any thoughts on why profile object isn't being passed post?
call save on profile object.
modalinstance.result.then(function () { profile.$save({uuid: uuid}); }, function () {});
Comments
Post a Comment