import { HttpClient , HttpHeaders } from '@angular/common/http' ; import { Injectable } from '@angular/core' ; export class HelloWorldBean { constructor ( public message ) { } } @ Injectable ( { providedIn : 'root' } ) export class WelcomeDataService { constructor ( private http ) { } executeHelloWorldBeanService ( ) { return this . http . get < HelloWorldBean > ( 'http://localhost:8080/hello-world-bean' ) ; } executeHelloWorldServiceWithPathVariable ( name ) { return this . http . get < HelloWorldBean > ( `http://localhost:8080/hello-world/path-variable/${ name }` ) ; } }