Skip to content

moisesphelipe/larangular-pagination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

larangular-pagination

This is a simple pagination with Laravel and Angular. You can see the [demo here] (http://pagination-angular-laravel.esy.es/#/)

##Installation

npm

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 example5

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

example3

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. example4

You can also limit how many page to show in the list, by default it is 9 example6

If you are using Angular material you can chage this value in according to user's screen example7

###Using in your app

    <la-pagination ng-hide="!articles.length" page-attr="{{pageAttr}}"> 	</la-pagination>

DEMO'S SCREENSHOT

example1

example2

About

An easy way to use pagination with Laravel and Angular

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published