Reputation: 3226
How can I navigate to a single event from a list of events?
<md-card *ngFor="let event of events | async">
<a href="" routerLinkActive="event/{{event.slug}}"><img class="event-img" src="http://lorempixel.com/30/30" />{{ event.name }}</a>
</md-card>
Upvotes: 0
Views: 77
Reputation: 24894
As said in docs of RouterLinkActive
:
The RouterLinkActive directive lets you add a CSS class to an element when the link's route becomes active.
To navigate, you should use RouterLink
:
<a [routerLink]="['event', event.slug]"
or
<a routerLink="event/{{event.slug}}"
Upvotes: 1