import { Injectable } from '@angular/core'; import { of } from 'rxjs'; import { map, tap } from 'rxjs/operators'; import { AppService } from '../app'; import { Task } from '../../models'; @Injectable({providedIn:'root'}) export class TasksService { ext = "/tasks"; constructor(private app:AppService){} fetch(){return this.app.http.get("/");} fetchOne(id:string){return this.app.http.get("/"+id);} create(o:Task){return this.app.http.post("/",o);} update(id:string,updates:Partial){return this.app.http.put("/"+id,updates);} remove(id:string){return this.app.http.del("/"+id);} }