diff --git a/src/app/hello/hello.component.ts b/src/app/hello/hello.component.ts index 4abcee1..103f0f8 100644 --- a/src/app/hello/hello.component.ts +++ b/src/app/hello/hello.component.ts @@ -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; + } }); } }