argos/dmp-frontend/src/app/form/tableOfContents/base-table-of-content.compo...

11 lines
430 B
TypeScript
Raw Normal View History

import { ActivatedRouteSnapshot, Router, ActivatedRoute } from '@angular/router';
2017-12-05 17:56:21 +01:00
2017-12-06 17:45:54 +01:00
export class BaseTableOfContent {
2018-10-05 17:00:54 +02:00
constructor(public router: Router, public route: ActivatedRoute) { }
2017-12-06 17:45:54 +01:00
2018-10-05 17:00:54 +02:00
scrollToId(elementId, page: number) {
//this.paginationService.setCurrentIndex(page-1);
this.router.navigate([this.route.snapshot.url[0] + '/' + this.route.snapshot.url[1]], { fragment: elementId, queryParams: { page: page } });
}
}