This is a simple pagination with Laravel and Angular. You can see the [demo here] (http://pagination-angular-laravel.esy.es/#/)
##Installation
npm install larangular-pagination
You cand download all the files in zip or clone this repository
git clone https://github.com/moisesphelipe/larangular-pagination.git
You can also have an app like in the demo just changing the branch to Laravel-Example
##Configuration
If you are using Laravel-Example provider in the branch, the only one thing that you need to do is, change the .env
file configuration for your database settings.
In order to use this in another project, you need to include the pagination.css
file in your project and also the pagination.directive.js
| pagination.html
.
###Setting up the pagination You gotta have in your request a params property to specify the page you want to load
Now it's Laravel time. Fortunately Laravel makes it easy. What you need to do is specify how many articles or whatever you want to, per page, like so
and then grab it in your Angular controller. Everything that you need here is the currentPage and the lastPage, you can remove all the other stuff if you want to.
You can also limit how many page to show in the list, by default it is 9
If you are using Angular material you can chage this value in according to user's screen
###Using in your app
<la-pagination ng-hide="!articles.length" page-attr="{{pageAttr}}"> </la-pagination>