import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { environment } from '../../environments/environment'; import { ApiBaseService } from './api.base-service'; @Injectable({ providedIn: 'root' }) export class ApiService extends ApiBaseService { apiURL = environment.apiURL; get authorization() { const token = document.cookie.match('(^|;) ?accesstoken=([^;]*)(;|$)'); const auth = token ? `Bearer ${token[2]}` : null; return auth; } constructor( protected http: HttpClient, ) { super(http); } }