Philipp
Philipp

Reputation: 4270

Angular 2 - Call method of a different (service-)component

I have a dashboard-component that displays a list of documents. For each document in the list i would like to provide a "delete-link".

Is there a way to directly call the delete-method of my document-service out of the dashboards html-template, rather than calling a method of my dashboard-component which forwards to the document-service?

Upvotes: 1

Views: 1720

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 658037

You can do

(click)="documentService.someMethod($event)"

Upvotes: 3

Related Questions