import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { Projects } from '../models/projects'; import { Project } from '../models/project'; @Injectable({ providedIn: 'root' }) export class ProjectsService { apiUrl = 'http://localhost:8080/api/projects/'; constructor(private http: HttpClient) {} getAllProjects(): Observable { return this.http.get(this.apiUrl); } getProject(permalink: String): Observable { return this.http.get(this.apiUrl + permalink); } }