IdanCo / ng1bs4

AngularJS with Bootstrap 4
https://idanco.github.io/ng1bs4
38 stars 12 forks source link

Improve Component - Pagination #67

Open langdonx opened 7 years ago

langdonx commented 7 years ago

I propose we stop we misusing anchors (href="#" ng-click="$event.preventDefault") in the pagination component. If the pagination-on-page-change binding is used, we should instead use <button class="btn btn-link"> (assuming it's visually the same).

It would also be ideal if we were able to support real anchors (with href). I'm thinking we would need to create a new binding that allowed for some kind of template to be passed in for the href attribute. Something like pagination-href-template="'/path/to/new/page?page={pageNumber}'".

IdanCo commented 7 years ago

Maybe it's the late hour, but i'm not sure i understand. What's the problem with the way it's implemented now? what would the href template improve?

langdonx commented 7 years ago

It would, dare I say "greatly", improve usability.

It would illustrate intent to the user so that they could know whether it can simply be left-clicked (if it were just a button) or middle-clicked / Ctrl-clicked (Command-clicked on OSX) if it were a link.

The way it is now, it's a fake anchor, so middle or Ctrl clicking it provides a new tab with no value. Allowing the possibility for it to be a real anchor (hopefully with ui-sref support) will in turn allow the pagination component to participate in browser history (push state) so that the user can hit the back button (or use the back button on their mouse if they have one) to get to the previous page.

langdonx commented 7 years ago

Some reading: