Closed langdonx closed 7 years ago
This resolves #28.
Resolved the issues we discussed above:
$onChanges
. I was surprised to see that it fires before $onInit
, so I had to move defaults to $onChanges
, but left validation errors in $onInit
so the console isn't flooded with them.Let me know if I missed anything, you catch any other weirdness, or you have any other ideas. We could probably add more options, but it seems like a good start.
Thank you so much for the awesome work!
btw - $onChanges receives a changeObject with a flag indicating the controller is initializing. But it can easily wait for the next PR...
Take a look and let me know what you think. Some things of note:
$scope
to$watch
the bindings for changes and regenerate which pages are displayed. I don't know of a way around this.visible-page-buffer
might be controversial, but I strongly think that it provides the best usability possible. It always bothered me that UI Bootstrap's implementation jumped around under my mouse as I clicked through pages. I think clicking a moving target is a UX anti-pattern.buildPages()
is fuzzy. The algorithm could certainly be improved--it was adapted from PHP I wrote some 10+ years ago, but it's solid and handles all scenarios I've thrown at it in the past as well as some tests I had running earlier usingng-repeat="items in $ctrl.generateRange(100)"
and variations of other attributes.src/library/pagination/pagination.scss
. I left the CSS there because I think it helps usability, but I didn't like hard-coding those color values.ngbs-pagination
. Seesrc/docs/utils/demo/demo.html
.