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