Adds API method for getting capabilities content from JSON
This commit is contained in:
parent
36cd1c276e
commit
9462940037
|
@ -2,7 +2,7 @@ import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable, throwError } from 'rxjs';
|
import { Observable, throwError } from 'rxjs';
|
||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
import { CaseStudy, TeamMember } from './interfaces';
|
import {Capability, CaseStudy, TeamMember} from './interfaces';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ApiService {
|
export class ApiService {
|
||||||
|
@ -11,6 +11,11 @@ export class ApiService {
|
||||||
constructor(private httpClient: HttpClient) {
|
constructor(private httpClient: HttpClient) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getCapabilities(): Observable<Capability[]> {
|
||||||
|
return this.httpClient.get<Capability[]>('./assets/json/capabilities.json')
|
||||||
|
.pipe((catchError(this.handleError)));
|
||||||
|
}
|
||||||
|
|
||||||
public getCaseStudies(): Observable<CaseStudy[]> {
|
public getCaseStudies(): Observable<CaseStudy[]> {
|
||||||
return this.httpClient.get<CaseStudy[]>('./assets/json/case-studies.json')
|
return this.httpClient.get<CaseStudy[]>('./assets/json/case-studies.json')
|
||||||
.pipe((catchError(this.handleError)));
|
.pipe((catchError(this.handleError)));
|
||||||
|
|
|
@ -28,4 +28,8 @@ export interface Testimonial {
|
||||||
caseStudy?: CaseStudy;
|
caseStudy?: CaseStudy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Capability {
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
icon_url: string;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue