本文整理匯總了TypeScript中ng-jhipster.PaginationUtil.parsePage方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript PaginationUtil.parsePage方法的具體用法?TypeScript PaginationUtil.parsePage怎麽用?TypeScript PaginationUtil.parsePage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng-jhipster.PaginationUtil
的用法示例。
在下文中一共展示了PaginationUtil.parsePage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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)
};
}
示例2:
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'])
};
}
示例3: 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';
}