Ember Component for Bootstrap 3 Pagination & Pager components
Here's a demo, and these are the original Bootstrap Components: Pagination and Pager.
- Ember.js v4.4 or above
- Ember CLI v4.4 or above
- Node.js v14 or above
ember install pagination-pagerThen use it in your app with <PaginationPager /> with the options
in the following section.
To switch to the pager UI, set the pager attribute to true, see the optional section.
By default the first page is 1, and the last is the value of count, you can change these by setting firstPage and lastPage.
@count-- The number of pages in total, required@current-- The current page number, required
@pager-- Switches to the pager component, defaults tofalse@urlTemplate-- Url template for supporting opening pages in new windows, defaults to '#'.@urlTemplateshould be in the form ofhttp://myurl.com/#/posts?page={current}.@hide-- Hide the component for any reason, defaults tofalse.@autoHide-- Hide the component ifcountis <=1, defaults totrue.@disabled-- Disable changing the pages, defaults tofalse.
@paginationNext-- The text to display for pagination next button@paginationPrevious-- The text to display for pagination previous button@paginationSize-- The size of the element, default is '', available options includelgandsm.@countOut-- The number of page links in the begin and end of whole range@countIn-- The number of page links on each side of current page
@pagerNext-- The text to display for the pager next button@pagerPrevious-- The text to display for the pager previous button@pagerFirst-- The text to display for the pager first button (no button is shown if not specified)@pagerLast-- The text to display for the pager last button (no button is shown if not specified)@pagerSpread-- Pager buttons spaced out, defaults to false
@change-- Action that returnscurrentPageandpreviousPage, e.g.
// clicking on '2' after '5'
@action
pageChanged(current, previous) {
console.log(current, previous);
// => 2, 5
}Note: If
changedis defined, thencurrentisn't updated automatically, it's your job to update it.
ember test works just fine, plus ember serve and then visit 'http://localhost:4200/pagination-pager/' to see the dummy app.
Build by checking out the relevant branch, since the test dummy app is actually the demo app.
See the Contributing guide for details.
ember github-pages:commit --message <message describing demo release>