Hi Olivier,

I don't use ngResource myself, but version 1 is the way to go if you do in 
my opinion. 
Its the way it is designed to be used that way.

Then I have a small observation on your code.
The following code:

    function find(id) {
      var deferred = $q.defer();
      if (id) {
        resource.get({ id: id }).$promise.then(function(result) {
          deferred.resolve(result);
        });
      }
      return deferred.promise;
    }

is exactly the same as:

    function find(id) {
       return resource.get({ id: id }).$promise
    }

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to