Skip to content

DropdownContext #5979

Closed Answered by waterplea
ng-alynasser asked this question in Q&A
Discussion options

You must be logged in to vote

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-…

Replies: 1 comment

Comment options

You must be logged in to vote
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
Category
Q&A
Labels
None yet
2 participants