I'm trying to figure out the best way to do an update of my model after doing an update.
So let's say I have my resource which I call to do an update, and then I attempt to do another query on the success function. I get into the success function and my query is successfuly done, but I can't seem to figure out how to get my result from the query back into my model's scope. Perhaps I'm taking the wrong approach for this?
Here's my example:
var myResource = new MyResource();
myResource.$update({
resourceId : resourceId
}, function (u) {
u.$query({
resourceId : resourceId
}, function (result){
$scope.mymodel = result;
})
});
So in my above example, I see my query successfully being called. But I never seem to get into my callback function on the query. But maybe going this route to do a query after an update is the wrong path? If I'm understanding correctly, the update (put) is asynchronous. So if I want to update my model after an update, I need to use a callback function or some other method?