Assume you have anchor element whose inner text you want to find on click of it
<a class="page-link" href="#" (click)="loadPaging($event.target)">{{page}} </a>
inside your typescript file you need function
loadPaging(eventtarget: any): void {
const anchor = eventtarget as HTMLElement;
this.currentPage = parseInt(anchor.innerText)
}
here this.currentPage has value of innerText of your anchor
No comments:
Post a Comment