below is the code:
<a [routerLink]="[ {outlets: { childModal: [targetType.routeName] } } ]" [ngClass]="{'disabled':isDisable}" title = "why popup is disabled" (click)="onTargetTypeClicked($event)">
Click-Me
</a>
//CSS-code
.disabled {
opacity: 0.5;
cursor: default !important;
pointer-events: none !important;
}
//JS-code
onTargetTypeClicked(event: any) {
event.preventDefault();
event.stopPropagation();
return false;
}
tried in both the ways CSS(hover is not working). JS(yet, my link is navigating. )
Note: i need to block user doing action & on mouse-hover user should be notified why it's blocked.
https://stackblitz.com/edit/angular-router-basic-example-5va1ro