I need to add
router= "/update/id" in my code, where "id" has to be rendered dynamically based on values by *ngFor directive. (i.e) {{obj.id}}.So that id gets rendered dynamically
How to do this?
You can either use String Interpolation
routerLink="/update/{{obj.id}}"
or Attribute Binding Syntax:
[routerLink]="'/update/' + obj.id"
or as Pankaj suggested, Attribute Binding Syntax like this:
[routerLink]="['/update', obj.id]"