ng-laravel-paginator
v0.0.4
Published
A package for angular to easy integration with Laravel pagination
Downloads
16
Maintainers
Readme
#NG Laravel Paginator
This package provides a easy way to use Pagination of the Laravel with AngularJS interface
See example here
#Install via bower
bower install https://github.com/wallacemaxters/ng-laravel-paginator.git
In Laravel method, you can use paginator like this:
Route::get('/users/list', function () {
return User::paginate();
});
In angular:
var app = angular.module('test', ['ng-laravel-paginator']);
app.controller('TestController', function ($scope, LaravelPaginator) {
$scope.users = new LaravelPaginator('/users/list');
// Or with query string
$scope.users = new LaravelPaginator('/users/list', {
search: 'wallace'
});
});
Html:
<div ng-controller="TestController">
<div ng-repeat="user in users.data">
{{ user.name}}
</div>
<a ng-click="users.next()">
Call the next page result
</a>
<div ng-show="users.isEmpty()">Result not found</div>
<!-- detect if request is busy -->
<div ng-show="users.busy">Loading</div>
</div>