I am trying to attach click event to anchor tags (coming from ajax) and block the default redirection. How can I do it in angular ?
I've been able to get this to work by simply using [routerLink]="[]". The square brackets inside the quotes is important. No need to prevent default actions in the method or anything. This seems to be similar to the "!!" method but without needing to add that unclear syntax to the start of your method.
So your full anchor tag would look like this:
Your Link
Just make sure your method works correctly or else you might end up refreshing the page instead and it gets very confusing on what is actually wrong!