DropdownContext #5979
DropdownContext
#5979
-
I'm implementing a dropdown context menu in a sperate component & passing its
How can I pass inputs & listen for outputs from that component? |
Beta Was this translation helpful? Give feedback.
Answered by
waterplea
Nov 20, 2023
Replies: 1 comment
-
There's no way to dynamically pass inputs and outputs to polymorpheus components. You can use context to pass data in, if you want to listen to some outputs — you can pass RxJS Subjects in context and use them to output some data. Or you can have your component in a template and for it not to be dynamic. Dynamic: <div tuiDropdownContext [tuiDropdown]="content"></div>
<ng-template #content>
<ng-container
*polymorpheusOutlet="zoneContextMenuComponent; context: { input: value, output: subject }"
></ng-container>
</ng-template> Non-dynamic: <div tuiDropdownContext [tuiDropdown]="content"></div>
<ng-template #content>
<zone-context [input]="value" (output)="onOutput($event)" />
</ng-template> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ng-alynasser
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's no way to dynamically pass inputs and outputs to polymorpheus components. You can use context to pass data in, if you want to listen to some outputs — you can pass RxJS Subjects in context and use them to output some data. Or you can have your component in a template and for it not to be dynamic.
Dynamic:
Non-dynamic: