In my template I am doing the following:
<tr *ngFor="let h of heroes">
How can I make it so View is a link that navigates to /heroes/:id? I have this setup in my route config. I verified that it works by going to http://localhost:4200/heroes/1
Am I better off using the (click) event and calling a function such as viewHero(id). If I did this I wouldn't be sure how to pass the id. Also, if it can be done directly inside of the html template within the href tag or routerLink I would like to know how to do that too. My main problem seems to be accessing h.id inside of a string such as href="".
I got the following to work, but still not happy with it:
There has to be a way to simply do this inside of the anchor tag directly. I am not getting a pointer finger when hovering the link.