26 lines
848 B
TypeScript
26 lines
848 B
TypeScript
import { HttpHeaders } from '@angular/common/http';
|
|
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
import { environment } from '../../../environments/environment';
|
|
import { BaseHttpService } from '../../core/services/http/base-http.service';
|
|
import { Language } from '../../models/language/Language';
|
|
|
|
@Injectable()
|
|
export class LanguageService {
|
|
private actionUrl: string;
|
|
private headers: HttpHeaders;
|
|
|
|
constructor(private http: BaseHttpService) {
|
|
|
|
this.actionUrl = environment.Server + 'common/';
|
|
|
|
this.headers = new HttpHeaders();
|
|
this.headers = this.headers.set('Content-Type', 'application/json');
|
|
this.headers = this.headers.set('Accept', 'application/json');
|
|
}
|
|
|
|
public getLang(): Observable<Language[]> {
|
|
return this.http.get<any>(this.actionUrl + 'language', { headers: this.headers });
|
|
}
|
|
}
|