As mentioned in the comments:
Create a new method in your component, called for example onAnchorClick, and let it handle the logic.
public onAnchorClick(page: number) {
if(page > 1) {
this.setPage(page - 1);
}
}
and tie it to your anchor
<a (click)="onAnchorClick(page)">Previous</a>
cyrix source
share