Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 115x 24x 24x 23x 9578x 2x 2x 1x 1x 1x 1x | import { Component, OnInit } from '@angular/core';
import { NgIf } from '@angular/common';
import { SelectModule } from 'primeng/select';
import { FormsModule } from '@angular/forms';
import { SignalCommandComponent } from '../signal-command/signal-command.component';
import { Signal } from '../../models/signals';
import { TwinpadApiService } from '../../services/twinpad-api.service';
@Component({
selector: 'app-signals-command',
imports: [SignalCommandComponent, NgIf, SelectModule, FormsModule],
templateUrl: './signals-command.component.html',
styleUrl: './signals-command.component.scss'
})
export class SignalsCommandComponent implements OnInit {
signalIds: string[];
_selectedSignalId: string;
signal: Signal | undefined;
constructor(private twinpadApiService: TwinpadApiService) {}
ngOnInit(): void {
this.twinpadApiService.getSignalsIds().subscribe({
next: signalIds => {
this.signalIds = signalIds;
}
});
}
get selectedSignalId() {
return this._selectedSignalId;
}
set selectedSignalId(newValue: string) {
this._selectedSignalId = newValue;
if (this._selectedSignalId === null) {
this.signal = undefined;
return;
}
this.twinpadApiService.getSignal(this._selectedSignalId).subscribe({
next: signal => {
this.signal = signal;
}
});
}
}
|