title: AngularJS pagination into dropdown
body: <p>I am new to <code>AngularJS</code> I am using its grid with filters, search, sort and pagination functions and it all works fine for me but one thing irritates me a lot to convert its pagination into drop-down box to select the page number like this</p>
  
  <pre><code>&lt;select name="pagination" class="form-control selectpicker"&gt;
      &lt;option value="fpage"&gt;First Page&lt;/option&gt;
      &lt;option value="p1"&gt;Page 1&lt;/option&gt;
      &lt;option value="p2"&gt;Page 2&lt;/option&gt;
      &lt;option value="p3"&gt;Page 3&lt;/option&gt;
      &lt;option value="lpage"&gt;Last Page&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>instead of pagination <code>list-items</code>. I tried of searching for the same solution but fails to get the right thing from the internet.</p>
  
  <p>Here is my HTML code which populates pagination</p>
  
  <pre><code>&lt;div class="col-md-12" ng-show="filteredItems == 0"&gt;
  &lt;div class="col-md-12"&gt;
  &lt;h4&gt;No products found&lt;/h4&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="col-md-12" ng-show="filteredItems &gt; 0"&gt;
  &lt;div pagination="" page="currentPage" on-select-page="setPage(page)" boundary-links="true" total-items="filteredItems" items-per-page="entryLimit" class="pagination-small" previous-text="&amp;laquo;" next-text="&amp;raquo;"&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And Here is my AngularJS code</p>
  
  <pre><code>var app = angular.module('myApp', ['ui.bootstrap']);
  
  app.filter('startFrom', function() {
      return function(input, start) {
          if(input) {
              start = +start; //parse to int
              return input.slice(start);
          }
          return [];
      }
  });
  app.controller('customersCrtl', function ($scope, $http, $timeout) {
      $http.get('includes/modServices/getServices.php').success(function(data){
          $scope.list = data;
          $scope.currentPage = 1; //current page
          $scope.entryLimit = 50; //max no of items to display in a page
          $scope.filteredItems = $scope.list.length; //Initially for no filter  
          $scope.totalItems = $scope.list.length;
      });
      $scope.setPage = function(pageNo) {
          $scope.currentPage = pageNo;
      };
      $scope.filter = function() {
          $timeout(function() { 
              $scope.filteredItems = $scope.filtered.length;
          }, 10);
      };
      $scope.sort_by = function(predicate) {
          $scope.predicate = predicate;
          $scope.reverse = !$scope.reverse;
      };
  });
  </code></pre>