Document onChange in umbPagination
This commit is contained in:
committed by
Nathan Woulfe
parent
a76924f196
commit
eb9c4e4d82
@@ -16,6 +16,7 @@ Use this directive to generate a pagination.
|
||||
total-pages="vm.pagination.totalPages"
|
||||
on-next="vm.nextPage"
|
||||
on-prev="vm.prevPage"
|
||||
on-change="vm.changePage"
|
||||
on-go-to-page="vm.goToPage">
|
||||
</umb-pagination>
|
||||
|
||||
@@ -34,10 +35,11 @@ Use this directive to generate a pagination.
|
||||
vm.pagination = {
|
||||
pageNumber: 1,
|
||||
totalPages: 10
|
||||
}
|
||||
};
|
||||
|
||||
vm.nextPage = nextPage;
|
||||
vm.prevPage = prevPage;
|
||||
vm.changePage = changePage;
|
||||
vm.goToPage = goToPage;
|
||||
|
||||
function nextPage(pageNumber) {
|
||||
@@ -51,6 +53,12 @@ Use this directive to generate a pagination.
|
||||
console.log(pageNumber);
|
||||
alert("prevpage");
|
||||
}
|
||||
|
||||
function changePage(pageNumber) {
|
||||
// do magic here
|
||||
console.log(pageNumber);
|
||||
alert("changepage");
|
||||
}
|
||||
|
||||
function goToPage(pageNumber) {
|
||||
// do magic here
|
||||
@@ -81,6 +89,11 @@ Use this directive to generate a pagination.
|
||||
<ul>
|
||||
<li><code>pageNumber</code>: The page number</li>
|
||||
</ul>
|
||||
@param {callback=} onChange (<code>binding</code>): Callback method when changing page.
|
||||
<h3>The callback returns:</h3>
|
||||
<ul>
|
||||
<li><code>pageNumber</code>: The page number</li>
|
||||
</ul>
|
||||
**/
|
||||
|
||||
(function() {
|
||||
@@ -175,9 +188,7 @@ Use this directive to generate a pagination.
|
||||
scope.onGoToPage(scope.pageNumber);
|
||||
}
|
||||
if (scope.onChange) {
|
||||
if (scope.onChange) {
|
||||
scope.onChange({ "pageNumber": scope.pageNumber });
|
||||
}
|
||||
scope.onChange({ "pageNumber": scope.pageNumber });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user