Node and channel API

This commit is contained in:
softsimon committed 2022-07-08 18:55:21 +02:00
1 parent 8d622e3606
commit f5325b3a6d
15 files changed
+174 -13

No files matched your search

@@ -0,0 +1 @@
<p>node works!</p>
Whitespace-only changes.
@@ -0,0 +1,29 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, ParamMap } from '@angular/router';
import { Observable } from 'rxjs';
import { switchMap } from 'rxjs/operators';
import { LightningApiService } from '../lightning-api.service';
@Component({
selector: 'app-node',
templateUrl: './node.component.html',
styleUrls: ['./node.component.scss']
})
export class NodeComponent implements OnInit {
node$: Observable<any>;
constructor(
private lightningApiService: LightningApiService,
private activatedRoute: ActivatedRoute,
) { }
ngOnInit(): void {
this.node$ = this.activatedRoute.paramMap
.pipe(
switchMap((params: ParamMap) => {
return this.lightningApiService.getNode$(params.get('id'));
})
);
}
}