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 { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { CaseStudy, TeamMember } from './interfaces';
|
||||
import {Capability, CaseStudy, TeamMember} from './interfaces';
|
||||
|
||||
@Injectable()
|
||||
export class ApiService {
|
||||
|
@ -11,6 +11,11 @@ export class ApiService {
|
|||
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[]> {
|
||||
return this.httpClient.get<CaseStudy[]>('./assets/json/case-studies.json')
|
||||
.pipe((catchError(this.handleError)));
|
||||
|
|
|
@ -28,4 +28,8 @@ export interface Testimonial {
|
|||
caseStudy?: CaseStudy;
|
||||
}
|
||||
|
||||
|
||||
export interface Capability {
|
||||
title: string;
|
||||
description: string;
|
||||
icon_url: string;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue