html
<div ng-controller="paginationDemoCtrl" class="text-center">
<pagination class="pagination-sm" total-items="totalItems" page="currentPage" on-select-page="pageChanged(chenyiqi)" previous-text="‹" next-text="›" num-pages="numPages" ></pagination><pre>共{ { numPages }}页,{ { totalItems }}条</pre>
</div>
指令
scope: {
page: '=',
totalItems: '=',
onSelectPage:' &'
},
指令中的onSelectPage指定引用标签中指明的父作用域中的函数,传递参数为chenyiqi;
$scope.onSelectPage({ chenyiqi: page });
在此处将给参数chenyiqi赋值