import { Injectable , Inject } from '@angular/core' ; import { Observable } from 'rxjs' ; import { HttpClient } from '@angular/common/http' ; @ Injectable ( ) export class OrdersService { baseUrl : string ; constructor ( private http , @ Inject ( 'BASE_URL' ) baseUrl ) { this . baseUrl = baseUrl ; } getOrdersById ( ) { const ordersUrl = `${ this . baseUrl }/api/user/orders` ; return this . http . get ( ordersUrl ) ; } }