Use new subscribe signature
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {HelloService} from '../../gen';
|
import {HelloResponse, HelloService} from '../../gen';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-hello',
|
selector: 'app-hello',
|
||||||
@ -15,8 +15,13 @@ export class HelloComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.helloService.getHello().subscribe(res => {
|
this.helloService.getHello().subscribe({
|
||||||
this.helloValue = res.value || "";
|
next: (response: HelloResponse): void => {
|
||||||
|
this.helloValue = response.value || "";
|
||||||
|
},
|
||||||
|
error: (err: Error): void => {
|
||||||
|
this.helloValue = err.message;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user