Reputation: 16420
I have a common route throughout my application, it is referenced like so:
<a [routerLink]="['/Project', {id: project.id, title: project.urlTitle}]" href="#">
{{project.title}}
</a>
How can I make this logic re-usable using a directive or similar?
I.E Ideally I'd like to do something like:
<a [project-link]="project"></a>
Upvotes: 3
Views: 162
Reputation: 657218
Just create a component that contains the routerLink
.
Upvotes: 2