I have a link:
<a routerLink="/test" (click)="testClick($event)">Test link </a>
I wanted to do in testClick
function something like this:
testClick(event:any) {
if (..some expression..) {
//custom popup confirmation
//if true --> event.preventDefault();
} else {
// go to link
}
}
But calling preventDefault
doesn't work. How can I fix it?