argos/dmp-frontend/src/app/services/language/language.service.ts

31 lines
1.2 KiB
TypeScript
Raw Normal View History

2018-03-28 15:24:47 +02:00
import { Injectable } from "@angular/core";
import { HttpHeaders } from "@angular/common/http";
import { BaseHttpService } from "../../utilities/cite-http-service-module/base-http.service";
import { HostConfiguration } from "../../app.constants";
import { Observable } from "rxjs/Observable";
import { Invitation } from "../../models/invitation/Invitation";
import { User } from "../../models/invitation/User";
import { RequestItem } from "../../models/criteria/RequestItem";
import { UserInvitationCriteria } from "../../models/criteria/invitation/UserInvitationCriteria";
import { Language } from "../../models/language/Language";
@Injectable()
export class LanguageService {
private actionUrl: string;
private headers: HttpHeaders;
constructor(private http: BaseHttpService) {
this.actionUrl = HostConfiguration.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<Language[]>(this.actionUrl + "language", { headers: this.headers });
}
}