Modif des services avec l'utilisation d'un "BaseService"
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { environment } from '../environments/environment';
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class BaseService {
|
||||
protected readonly headers: HttpHeaders;
|
||||
protected readonly apiUrl: string;
|
||||
|
||||
constructor() {
|
||||
this.headers = new HttpHeaders({
|
||||
'Access-Control-Allow-Origin': environment.apiUrl
|
||||
});
|
||||
|
||||
this.apiUrl = environment.apiUrl + '/api';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user