本文整理匯總了TypeScript中ng-jhipster.PaginationUtil類的典型用法代碼示例。如果您正苦於以下問題:TypeScript PaginationUtil類的具體用法?TypeScript PaginationUtil怎麽用?TypeScript PaginationUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了PaginationUtil類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
resolveFn: (paginationUtil: PaginationUtil, trans: Transition) => {
const stateParams = trans.params();
return {
page: paginationUtil.parsePage(stateParams['page']),
sort: stateParams['sort'],
predicate: paginationUtil.parsePredicate(stateParams['sort']),
ascending: paginationUtil.parseAscending(stateParams['sort'])
};
}
示例2: constructor
constructor(
private userService: UserService,
private parseLinks: ParseLinks,
private alertService: AlertService,
private principal: Principal,
private $state: StateService,
private eventManager: EventManager,
private paginationUtil: PaginationUtil,
private paginationConfig: PaginationConfig
) {
this.itemsPerPage = ITEMS_PER_PAGE;
this.page = paginationUtil.parsePage($state.params['page']);
this.previousPage = this.page;
this.reverse = paginationUtil.parseAscending($state.params['sort']);
this.predicate = 'id';
}
示例3: resolve
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
const page = route.queryParams['page'] ? route.queryParams['page'] : '1';
const sort = route.queryParams['sort'] ? route.queryParams['sort'] : 'id,asc';
return {
page: this.paginationUtil.parsePage(page),
predicate: this.paginationUtil.parsePredicate(sort),
ascending: this.paginationUtil.parseAscending(sort)
};
}