import { Injectable } from '@angular/core' ; import { Observable } from 'rxjs' ; import { map } from 'rxjs/operators' ; import { ApiCallService , ApiService , resp } from '../../services/api-call.service' ; import { CmdbDao } from '../models/cmdb-dao' ; import { HttpHeaders } from '@angular/common/http' ; export const httpObserveOptions = { headers : new HttpHeaders ( { 'Content-Type' : 'application/json' } ) , observe : resp } ; export const PARAMETER = 'params' ; export const COOCKIENAME = 'onlyActiveObjCookie' ; @ Injectable ( { providedIn : 'root' } ) export class SpecialService < T = CmdbDao > implements ApiService { public servicePrefix : string = '/' ; constructor ( private api ) { } public getIntroStarter ( ) { httpObserveOptions [ PARAMETER ] = { onlyActiveObjCookie : this . api . readCookies ( COOCKIENAME ) } ; return this . api . callGet < T [ ] > ( this . servicePrefix + '/special/intro' , httpObserveOptions ) . pipe ( map ( ( apiResponse ) => { return apiResponse . body ; } ) ) ; } }