app/src/commons/component/nic-dropdown.component.ts

36 lines
823 B
TypeScript
Raw Normal View History

2018-08-26 11:09:12 +00:00
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';
2018-08-17 10:53:40 +00:00
@Component({
selector: 'app-nic-dropdown',
templateUrl: './nic-dropdown.component.html',
styleUrls: ['./nic-dropdown.component.scss'],
})
2018-08-26 11:09:12 +00:00
export class NicDropdownComponent implements OnInit {
2018-08-18 01:04:59 +00:00
@Input() blockTarget: any;
2018-08-17 10:53:40 +00:00
constructor(
2018-08-26 11:09:12 +00:00
private probeService: ProbeService,
2018-08-17 10:53:40 +00:00
) {
}
2018-08-26 11:09:12 +00:00
ngOnInit(): void {
this.probeService.call<any>('MachineService.Interfaces').pipe(
map((ifaces: any) => {
console.log(ifaces);
}),
catchError(error => {
console.log(error);
return of();
}),
take(1),
).subscribe();
}
2018-08-17 10:53:40 +00:00
}