I've got an AngularJS resource implementation, which (in principle) works fine. Now the special circumstances are:
- one of the fields (attributes) of the resource is the "last changed timestamp"
- if it arrives at the server in an updating request, it is ignored. The sever sets the "last changed timestamp" always automatically
- the updating methods on the server are all implemented in a way, that the response is empty (rather than containing the modified entity)
So under these circumstances, to get the "last changed timestamp" after an update operation from the server, I always have to do a get immediately following the update.
myEntity.$update( function(){ myEntity.$get(); } );
Now the question is: Does AngularJS offer a way to automatically chain actions:
- to define in the MyEntity definition, that it needs to always do a $get after the $update.
and then, in application code just call
myEntitty.$update();