top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

In Angular(2/4/5), What is the difference between [routerLink] vs routerLink ?

0 votes
632 views
In Angular(2/4/5), What is the difference between [routerLink] vs routerLink ?
posted Jan 16, 2018 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

[routerLink] and routerLink are both used to link the routes from Html.
In [routerLink] we can provide the values dynamically whereas in routerLink we can't pass dynamic values.

[routerLink] Example

<a [routerLink] = [currentLink]>Back </a>

Component File

this.currentLink = 'home';

routerLink Example

<a routerLink = "home">Back </a>
answer Jan 24, 2018 by Manish Tiwari
...