<commit_before># Angular Bootstrap page size changer directive

A lightweight pagination directive that is focused on ... changing page size. It was not covered by [UI Bootstrap](http://angular-ui.github.io/bootstrap/) so here it is.

With this and the pagination directive you can have a complete server side paging with Angular.

## Settings

Settings can be provided as attributes in the `<sl-page-size-changer>` :

 * `ng-model` (mandatory) : Maximum number of items per page. You'll have to initialize it.

 * `ng-change` (mandatory for now) : Will be called when the itemsPerPage (ngModel) change.

 * `total-items` (default NULL) : Total number of items in all pages.

 * `items-per-page-list` (mandatory) : Array of all page sizes.

## Usage

### Controller

```javascript
angular.module('myApp', ['seblucas.slPageSizeChanger'])
.controller('demoCtrl', ['$scope', 'myDataService', function($scope, myDataService) {
    $scope.itemsPerPage = 48;
    $scope.itemsPerPageList = [24, 48, 96, 192];
    $scope.maxSize = 10;
    $scope.currentPage = 1;
    $scope.list = [];

    $scope.pageChanged = function() {
      myDataService.query()
                   .then(function(result) {
        $scope.totalItems = result.totalItems;
        $scope.list = result.list;
      });
    };

    $scope.pageChanged ();
  }]);
```

### View

```html
<h1>Title</h1>
<pagination total-items="totalItems" items-per-page="itemsPerPage" max-size="maxSize" ng-model="currentPage" ng-change="pageChanged()"></pagination>
<sl-page-size-changer total-items="totalItems" ng-model="itemsPerPage" ng-change="pageChanged()" items-per-page-list="itemsPerPageList"></sl-page-size-changer>
<br />
<div class="row" ng-repeat="item in list">
{{item.name}}
</div>
```

## License

Licensed under MIT.<commit_msg>Fix the formatting of the HTML view<commit_after># Angular Bootstrap page size changer directive

A lightweight pagination directive that is focused on ... changing page size. It was not covered by [UI Bootstrap](http://angular-ui.github.io/bootstrap/) so here it is.

With this and the pagination directive you can have a complete server side paging with Angular.

## Settings

Settings can be provided as attributes in the `<sl-page-size-changer>` :

 * `ng-model` (mandatory) : Maximum number of items per page. You'll have to initialize it.

 * `ng-change` (mandatory for now) : Will be called when the itemsPerPage (ngModel) change.

 * `total-items` (default NULL) : Total number of items in all pages.

 * `items-per-page-list` (mandatory) : Array of all page sizes.

## Usage

### Controller

```javascript
angular.module('myApp', ['seblucas.slPageSizeChanger'])
.controller('demoCtrl', ['$scope', 'myDataService', function($scope, myDataService) {
    $scope.itemsPerPage = 48;
    $scope.itemsPerPageList = [24, 48, 96, 192];
    $scope.maxSize = 10;
    $scope.currentPage = 1;
    $scope.list = [];

    $scope.pageChanged = function() {
      myDataService.query()
                   .then(function(result) {
        $scope.totalItems = result.totalItems;
        $scope.list = result.list;
      });
    };

    $scope.pageChanged ();
  }]);
```

### View

```html
<h1>Title</h1>
<pagination total-items="totalItems" 
            items-per-page="itemsPerPage" 
            max-size="maxSize" 
            ng-model="currentPage" 
            ng-change="pageChanged()">
</pagination>
<sl-page-size-changer total-items="totalItems" 
                      ng-model="itemsPerPage" 
                      ng-change="pageChanged()" 
                      items-per-page-list="itemsPerPageList">
</sl-page-size-changer>
<br />
<div class="row" ng-repeat="item in list">
{{item.name}}
</div>
```

## License

Licensed under MIT.
{'fraction_non_alphanumeric': 0.14565976887933352, 'fraction_numerical': 0.00859983875302338, 'mean_word_length': 3.399527186761229, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7498342', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1120, 'n_words': 315}