javascript - Passing multiple objects to angularjs $resource.save() -
i have operation contract on server looks this:
[operationcontract] [webinvoke(method = "post", uritemplate = "/registerorganization", requestformat = webmessageformat.json, responseformat = webmessageformat.json, bodystyle = webmessagebodystyle.bare)] void registerorganization(organization organization, user admin);
now on client-side have following resource:
var registerorganization = $resource(baseurlservice.getbaseurl() + 'rest/organization.svc/registerorganization');
my question how can pass 2 objects parameters this:
registerorganization.save(organization,admin)
i 500 server error doing this, ideas how can achieve this?
don't know server side call save
method of $resource
first accepts query string parameters sent query string like:
rest/organization.svc/registerorganization?organizationname=stackoverflow&site=
while 2nd parameter sent json. , server side call accepts data json. consider change:
var data = angular.extend({}, organization, admin); registerorganization.save(null, data);
Comments
Post a Comment