Angular wiping out resource() function from object

I've encountered an issue where Angular wipes out the resource() function from the object. This is because ng-Resource changes the object's type to Resource so that the HateoasInterface prototype is no longer accessible.

To fix this, I've moved the resource() function to the extend() statement instead of the prototype.