How do I approach sharing ng-template throughout my Angular app?

Viewed 5368

Assuming that I have a typeahead component in Angular that shows the lookup matches it receives from backend endpoint. I want to style the match items and I am able to do so via ng-template, ngTemplateOutlet and ngTemplateOutletContext.

No problem here.

The problem is - how do I apply DRY approach and make this ng-template re-usable, so that I don't have to paste it into each and every container that wants to use it?

Updated: At the same time, I want to be able to use the typeahead component for other type of entities which require another template.

I am not asking for code, I am asking about the general approach.

1 Answers
Related