RouterLink



RouterLink
The routerLink defines how the user navigates to the route (or URL) declaratively in the component template.
<a [title]="product.name + ' details'" [routerLink]="['/products', productId]">
      {{ product.name }}
</a>

The RouterLink directive gives the router control over the anchor element. In this case, the route (URL) contains one fixed segment (/products) and the final segment is variable, inserting the id property of the current product.