Angularjs: Transform data before send with ng-resource and transformRequest
<p>I want to change some data before sending it to the server via ng-resource. I use the tranformRequest-Function like this:</p>

<pre><code>    update: {
        method: 'PUT',
        transformRequest: function (data) {
             // modify data then
             return data;
        }
    }
</code></pre>

<p>I can modify data this way but in the request my data is always serialized. I want keep my data as JSON. Is this possible with transformRequest or have this to be done in controller. I would prefer to do it in the service. Thx for help</p>