我正在尝试按照此处的示例进行分页。
我已经能够进入一个能够显示新页码的阶段,但我无法触发点击事件。在下面的示例中,我可以做些什么来触发data-ng-click="setPage()"
寻呼机
<!doctype html>
<html ng-app="PagingModule">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js"></script>
<script type="text/javascript" src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.5.0.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css"
rel="stylesheet">
<script type="text/javascript">
var PagingModule = angular.module('PagingModule', ['ui.bootstrap']);
PagingModule.controller('PaginationCtrl', function PaginationCtrl($scope) {
$scope.noOfPages = 7;
$scope.currentPage = 1;
$scope.setPage = function () {
alert("in");//I am unable to reach this code
};
}
);
</script>
</head>
<body>
<div ng-controller="PaginationCtrl" class="well well-small">
<pagination data-ng-click="setPage()" boundary-links="true" num-pages="noOfPages"
current-page="currentPage" class="pagination-small" previous-text="‹"
next-text="›" first-text="«" last-text="»"></pagination>
{{currentPage}}
</div>
</body>
</html>