function IssueListController($resource) {
var scope = this;
var Issue = $resource('rest/issues/list');
scope.issues = [];
scope.criteria = {};
scope.getIssues = function() {
scope.issues = Issue.query(scope.criteria);
}
}
"scope.criteria" is bound to the form, so user can fill them and
$resource will generate URL like:
/issues/list?receiptDate=2012-01-01&signature=ABC
I wish I could use plain-old $xhr/$http, because I am starting to
remember why I never liked $resource. By default it uses $xhr.cache,
so once user asks for issues, the result will never be updated. New
issues can be registered by a bunch of users, but $resource will keep
saying there is nothing new on the server (oh why... why?).
I know it is possible to disable cache by overriding or registering
new methods on types generated by $resource, but maybe there is some
nice, clean and simple way to get rid of $resource caching "feature"
globally?
Thanks, Angular rulez! :)
Witold Szczerba