michaelbromley / michaelbromley/angularUtils
dirPagination: how to match the data with the pagenum by using the promise?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 842
- PR merge metrics
- No merged PRs in 30d
Description
Hi!Thanks for your nice lib
Here is my question
I am tesing the dirPagination with AngularJS 1.5.8 and using the promise to get the server-side data
every time I call the function,it will return the 10 objects and the totalnum of all data just like below:
{
total : 59,
data: [
{ // item 1... },
{ // item 2... },
{ // item 3... },
...
{ // item10... }
]
}
and my function in my controller like below:(call this function once,it return 10results and the totalnum at a time)
function getData(){
var promise = Service.get($scope.term);
promise.then(function(result) {
$scope.totalItems = result.total
var ii = 0
for (; ii < result.data.length; ii++) {
$scope.results.push(result.data[ii]);
}
});
}
like the example above,total 59 objects,it will make 59/10 = 6 pagination links.
but how can I match every 10 objects with each pagination link?
I don't get all the data at once.
how to show the correct data which have been matched with?
how to set up a $watch with the code above?
any ideas?
Thanks a lot!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by reviewing the dirPagination server-side pagination entry point and the AngularJS controller flow shown in the issue, then verify how a promise response containing total and 10 data items should map to each pagination link. Done means the documented usage clearly explains how to request and display the correct page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs, javascript
- Domain
- documentation, frontend
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100