Use new subscribe signature

This commit is contained in:
2025-01-25 10:33:13 +01:00
parent f5094cad60
commit 76c5fe3775

View File

@ -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;
}
});
}
}