I have an empty array and this is how I push an item into it, which includes an <a> tag:
this.errors.push('At least 1 <a (click)="jumpToError($event)" href="">service</a> should be added.');
<ul *ngFor="let error of errors">
<li [innerHTML]="error"></li>
</ul>
When the user clicks on that link, I want to invoke the following function:
jumpToError(event: MouseEvent): void {
event.preventDefault();
console.log('Clicking works!')
}
My problem is, when I click on that link, the same page will be reloaded and I can't see whether the function has been invoked or not.