Skip to content

Angular component support #483

@nidhinpv19

Description

@nidhinpv19

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions