Or you can simply add a condition to the attribute.
<button [routerLink]="myVar ? ['/myScreen'] : []"></button>
Redirect to ‘/myScreen’ only if myVar is true.
Or you can simply add a condition to the attribute.
<button [routerLink]="myVar ? ['/myScreen'] : []"></button>
Redirect to ‘/myScreen’ only if myVar is true.