This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Meta Data #21
Comments
I'd create a fetchPaged method loosely based on on ActiveRecord.fetchAll() in my base class: var BaseRecord = ActiveRecord.extend({
}, {
fetchPaged: function (options) {
// Return a promise that returns a object with both the results and the meta data.
// ...
}
} );
var Comment = BaseRecord.extend({
$urlRoot: '/api/comments'
});
Comment.fetchPaged({page: 2}).then(function (result) {
$scope.comments = result.items;
$scope.total = result.totalCount;
}); |
Alright this is my solution for a model called Creative:
Now I just need to find a way to refactor so that I can apply that to any model. |
xob
pushed a commit
to cognibox/angular-activerecord
that referenced
this issue
Apr 16, 2019
Add test for validation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello there,
This module looks good! What would be the best approach to include meta data in an index though? For example, if the backend has the following json format for an index call:
The text was updated successfully, but these errors were encountered: