Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular component support #483

Open
nidhinpv19 opened this issue Jun 4, 2024 · 0 comments
Open

Angular component support #483

nidhinpv19 opened this issue Jun 4, 2024 · 0 comments

Comments

@nidhinpv19
Copy link

I have one doubt while integrating with angular. We have our own angular component and we need to integrate it like combobox or normal input field. Can anyone help on this?

For Examaple:

// class litegraphDropdownNode extends LGraphNode {
// public dropdownOptions: { id: number; text: string; }[];
// public selectedOption: { id: number; text: string; };
// constructor() {
// super();
// // Define node properties
// this.addOutput("Output", "number");
// // Angular Material dropdown options
// this.dropdownOptions = [
// {id: 1, text: "Option 1"},
// {id: 2, text: "Option 2"},
// {id: 3, text: "Option 3"},
// ];
// // Default selected option
// this.selectedOption = this.dropdownOptions[0];
// }
// // Override onDrawForeground to render dropdown
// public onDrawForeground(ctx, canvas): void {
// // Render Angular Material dropdown
// const dropdown = document.createElement("div");
// dropdown.innerHTML = // <dropdown-field class="rete-reference" // [value]="value" // [items]="items" // [existingItemsOnly]="!multiple" // [mode]="multiple ? 'multiple' : 'single'" // [listContainer]="'body'" // [itemValueKey]="'id'" // [itemTextKey]="'name'" // [maxListHeight]="'250px'" // [autofocus]="true" // listStyleClass="vm-predicates-graph__reference-list-container" // (valueChange)="updateValue($event)"> // </dropdown-field> //;
// }
// public updateValue(event: any): void {
// this.selectedOption = event;
// // Output the selected option value
// this.setOutputData(0, this.selectedOption);
// }
// // Override onExecute to handle node execution
// public onExecute(): void {
// // Output the selected option value
// this.setOutputData(0, this.selectedOption);
// }
// }
// LiteGraph.registerNodeType("custom/dropdownNode", litegraphDropdownNode);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant