import { Component, Input, OnInit } from '@angular/core'; import { Observable, Subscription, of } from 'rxjs'; import { catchError, exhaustMap, map, tap, take } from 'rxjs/operators'; import { ProbeService } from '../service/probe.service'; @Component({ selector: 'app-nic-dropdown', templateUrl: './nic-dropdown.component.html', styleUrls: ['./nic-dropdown.component.scss'], }) export class NicDropdownComponent implements OnInit { @Input() blockTarget: any; constructor( private probeService: ProbeService, ) { } ngOnInit(): void { this.probeService.call('MachineService.Interfaces').pipe( map((ifaces: any) => { console.log(ifaces); }), catchError(error => { console.log(error); return of(); }), take(1), ).subscribe(); } }