Adds API method for getting capabilities content from JSON

This commit is contained in:
Aaron Louie 2019-10-14 18:06:38 -04:00
parent 36cd1c276e
commit 9462940037
2 changed files with 11 additions and 2 deletions

View File

@ -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)));

View File

@ -28,4 +28,8 @@ export interface Testimonial {
caseStudy?: CaseStudy;
}
export interface Capability {
title: string;
description: string;
icon_url: string;
}