angularUtils icon indicating copy to clipboard operation
angularUtils copied to clipboard

dirPagination: range.lower is 1 when range.total == 0

Open sasham43 opened this issue 8 years ago • 3 comments

range.lower is 1 even when the collection is empty, so when using a custom template it displays 'Showing 1-0 of 0'

https://plnkr.co/edit/FHqqsJRVPrp50CAobTld?p=preview

sasham43 avatar Feb 01 '17 17:02 sasham43

Thanks for the report.

If anyone wants to have a go at fixing this, comment below. Honestly I have little time right now to work on this.

michaelbromley avatar Feb 15 '17 09:02 michaelbromley

I am basically having this exact problem!

I have an array of items with detail data for each item displayed. When deleting the item objects from the array, it deletes all of them, but it does not delete the last one from the view model. It is gone from the data, but it's being held onto by something in the dirPaginate directive.

When I replaced dir-paginate with ng-repeat, I was able to verify that it is, in fact, working as expected, but something appears to be preventing it from reflecting that the last item was deleted. This is the closest issue I have seen to match the behavior I am witnessing on my end. My friend said something about it being related to the way $compile is being done?

GLoganDR avatar Apr 19 '17 16:04 GLoganDR

hi @sasham43 see my workaround.

https://plnkr.co/edit/9zqhQuRHifqkqQ92P4Lw?p=preview

florentino avatar May 31 '18 08:05 florentino