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