Insert value into db.json with help of angular-resource
<p>I have a json file named db.json which is like </p>

<pre><code>{
"menu":[
 {
   "id":0,
   "item":"item1"
},{
   "id":1,
   "item":"item2"
},{
   "id":2,
   "item":"item3"
}
],
"feedback":[]
}
</code></pre>

<p>I am using angular <code>$resource</code> to <code>PUT</code> an Javascirpt object into the <code>feedback</code> array. </p>

<p>Here is my service code-</p>

<pre><code>this.getFeedbacks = function(){
            return $resource(baseURL + "feedback/:id", null, {
                'update': {
                    method: 'PUT'
                }
            });
        };
</code></pre>

<p>And here is the controller code-</p>

<pre><code>$scope.fb.push($scope.myFeedback);
 menuFactory.getFeedbacks().update({
            id: $scope.fb.id
        }, $scope.fb);
</code></pre>

<p>Notice that the <code>feedback</code> array in the json is empty and the $scope.myFeedback is found from a ng-controller's ng-model and this ng-controller has a submit button when I click on the submit button then the values of the inputs are stored into the json file.
<br>The HTML code is-</p>

<pre><code>&lt;form name="feedbackForm" ng-submit="setFeedback()"&gt;
   &lt;input type="text" name="name" ng-model="myFeedback.name"&gt;
   &lt;input type="submit" name="submit" value="feedback"&gt;
&lt;/form&gt;
</code></pre>

<p>My update function is not working why please someone explain it.
Note that I am very beginner at angularJS platform and REST client-server networking. </p>