File

src/app/components/add-weighted-edge/add-weighted-edge.component.ts

Description

Angular component representing the form for adding a weighted edge.

Metadata

selector app-add-weighted-edge
styleUrls add-weighted-edge.component.css
templateUrl add-weighted-edge.component.html

Inputs

container

Input property to receive data from a parent component.

Type: any

nodeS

Input property representing the source node for the edge.

Type: any

nodeT

Input property representing the target node for the edge.

Type: any

Outputs

weight

Event emitter for emitting the weight of the edge to the parent component.

$event type: EventEmitter<number>

Constructor

constructor(grapheS: any)

Initializes a new instance of the AddWeightedEdgeComponent class.

Parameters :

Methods

onWeightFormChange
onWeightFormChange()

Event handler for when the weight form changes.
Emits the weight value to the parent component using the weight EventEmitter.

Returns: void

Properties

weightForm
weightForm: any

The form field for entering the edge weight.

import { Component, Input, Output, EventEmitter } from '@angular/core';
import { GrapheService } from 'src/app/Services/graphe.service';

/**
 * Angular component representing the form for adding a weighted edge.
 */
@Component({
  selector: 'app-add-weighted-edge',
  templateUrl: './add-weighted-edge.component.html',
  styleUrls: ['./add-weighted-edge.component.css']
})
export class AddWeightedEdgeComponent {
  /**
   * Input property representing the source node for the edge.
   */
  @Input() nodeS: any;

  /**
   * Input property representing the target node for the edge.
   */
  @Input() nodeT: any;

  /**
   * Input property to receive data from a parent component.
   */
  @Input() container: any;

  /**
   * Event emitter for emitting the weight of the edge to the parent component.
   */
  @Output() weight: EventEmitter<number> = new EventEmitter<number>();

  /**
   * The form field for entering the edge weight.
   */
  weightForm: any;

  /**
   * Initializes a new instance of the AddWeightedEdgeComponent class.
   *
   * @param {GrapheService} grapheS - The GrapheService instance.
   */
  constructor(protected grapheS: GrapheService) {}

  /**
   * Event handler for when the weight form changes.
   * Emits the weight value to the parent component using the `weight` EventEmitter.
   */
  onWeightFormChange(): void {
    this.weight.emit(this.weightForm);
  }
}

results matching ""

    No results matching ""