When working with $resource in Angular for CRUD operations, I'm encountering some confusion regarding the usage of different resource methods.
From what I've observed, the "regular" methods like save()
and get()
appear to execute synchronously. If you need asynchronous behavior, you can provide a callback function to run upon completion. Additionally, each method's result includes a $promise
property that returns a promise, enabling asynchronous handling (which is my preferred approach).
However, there also exist $
versions of these methods, except for get()
and query()
. I am puzzled by the absence of $get()
or $query()
and wonder if these $
methods serve as shortcuts for .$promise
.