Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between delete and remove method in $resource?

What is the difference between delete and remove methods? Both of them use DELETE method of HTTP. I couldn't find any reasonable information.

like image 633
Paul Avatar asked Mar 29 '13 15:03

Paul


People also ask

What is the difference between remove () and pop ()?

The remove() function removes the first matching value from the list. The pop() function is used to return the removed element from the list.

What is the difference between remove and delete in Python?

In python del is a keyword and remove(), pop() are in-built methods. The purpose of these three are same but the behavior is different remove() method delete values or object from the list using value and del and pop() deletes values or object from the list using an index.

Is del the same as delete?

Both the Del or Delete key and Backspace key can delete text. However, when dealing with text, pressing the Del deletes text to the right of the cursor.


1 Answers

I don't believe there is any difference. Angular source code:

angular.module('ngResource', ['ng']).   factory('$resource', ['$http', '$parse', function($http, $parse) {     var DEFAULT_ACTIONS = {       'get':    {method:'GET'},       'save':   {method:'POST'},       'query':  {method:'GET', isArray:true},       'remove': {method:'DELETE'},       'delete': {method:'DELETE'} 

From Eric W. (his edit was rejected before I could approve it): AngularJS by Green & Seshadri warns that the delete method may not work in IE unless bracket notation is used (myResource[delete]()) as delete is a reserved word. So you may want to consider using the remove method instead.

like image 120
Mark Rajcok Avatar answered Oct 08 '22 12:10

Mark Rajcok