app/core/services/taxonomy-services/taxonomy.service.ts
Properties |
Id |
Id:
|
Type : string
|
Key |
Key:
|
Type : string
|
Value |
Value:
|
Type : string
|
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/internal/Observable';
import { PublicationService } from '../publication-service/publication.service';
import { HttpClient } from '@angular/common/http';
import { AppConfig } from 'src/app/app.config';
export interface TaxonomySchema {
Key: string;
Value: string;
Id: string;
}
@Injectable({
providedIn: 'root'
})
export class TaxonomyService {
constructor(public publicationService: PublicationService, public httpClient: HttpClient) { }
public getTaxonomyData(...values: string[]): Observable<TaxonomySchema> {
const pubPath = this.publicationService.getPublicationPath();
let taxonomyTypePath = '';
values.forEach((val, index) => {
taxonomyTypePath += val + '/';
});
const requestUrl = AppConfig.settings.taxonomyService.path.replace('/PUBLICATIONPATH', pubPath) + taxonomyTypePath;
return this.httpClient.get<TaxonomySchema>(requestUrl);
}
}