I can find lots of Q&As on dropdown components that have the content dynamically created, something like this:
<dropdown (items)="some.items" [click]="doSomething($event)" etc... />
I need a more generic and reusable directive that would allow the dropdown to contain any logic / template. Something like:
<dropdown>
<button class="dropdown-toggle">Toggle Dropdown!</button>
<something class="dropdown-content">This is the dropdown content...</button>
</dropdown>
The directive needs to provide the logic to handle element hide / show toggle and document click (not on the element) to hide the dropdown. What the best way to tackle this? All the Angular 2 stuff I have done is component this their own views...
templateinstruction of the@componentdeclaration?