Open langdonx opened 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?
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.
I propose we stop we misusing anchors (
href="#" ng-click="$event.preventDefault"
) in the pagination component. If thepagination-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 thehref
attribute. Something likepagination-href-template="'/path/to/new/page?page={pageNumber}'"
.