Creating Buttons That Act Like Links in Angular

While working on a pet project in Angular tonight, I wanted to create some buttons that act like links. Turns out, this is easy -- just apply the routerLink directive to a button and it will act like a link. Here's an example:

<button class="btn btn-success" routerlink="/exercises/edit">Edit an Exercise</button>

Comments

Popular Posts

Resolving the "n timer(s) still in the queue" Error In Angular Unit Tests

Silent Renew and the "login_required" Error When Using oidc-client

How to Get Norton Security Suite Firewall to Allow Remote Desktop Connections in Windows

Fixing the "Please add a @Pipe/@Directive/@Component annotation" Error In An Angular App After Upgrading to webpack 4

How to Determine if a Column Exists in a DataReader