Skip to content

Instantly share code, notes, and snippets.

@rouge8
Last active December 18, 2015 00:58
Show Gist options
  • Save rouge8/5700330 to your computer and use it in GitHub Desktop.
Save rouge8/5700330 to your computer and use it in GitHub Desktop.
angular.module('plunker', ['ui.bootstrap']);
var PaginationDemoCtrl = function ($scope, $location) {
$scope.numPages = 7;
console.log('page should be', $location.search().page);
$scope.currentPage = $location.search().page;
};
<!doctype html>
<html ng-app="plunker">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.3.0.js"></script>
<script src="example.js"></script>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
</head>
<body>
<div ng-controller="PaginationDemoCtrl">
<pagination num-pages="numPages" current-page="currentPage" class="pagination-small" previous-text="&laquo;" next-text="&raquo;"></pagination>
Current Page is {{currentPage}}.
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment