From 9462940037ef53285a9dd2c69306f754774f9d11 Mon Sep 17 00:00:00 2001 From: Aaron Louie Date: Mon, 14 Oct 2019 18:06:38 -0400 Subject: [PATCH] Adds API method for getting capabilities content from JSON --- src/app/api.service.ts | 7 ++++++- src/app/interfaces.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/app/api.service.ts b/src/app/api.service.ts index aa38fb4..0637b4d 100644 --- a/src/app/api.service.ts +++ b/src/app/api.service.ts @@ -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 { + return this.httpClient.get('./assets/json/capabilities.json') + .pipe((catchError(this.handleError))); + } + public getCaseStudies(): Observable { return this.httpClient.get('./assets/json/case-studies.json') .pipe((catchError(this.handleError))); diff --git a/src/app/interfaces.ts b/src/app/interfaces.ts index 5f5100b..2d48395 100644 --- a/src/app/interfaces.ts +++ b/src/app/interfaces.ts @@ -28,4 +28,8 @@ export interface Testimonial { caseStudy?: CaseStudy; } - +export interface Capability { + title: string; + description: string; + icon_url: string; +}