Open History to see the last commit
1import { HttpClient } from '@angular/common/http'
2import { Injectable, inject } from '@angular/core'
3β
4@Injectable({
5 providedIn: 'root',
6})
7export class TasksAPI {
8 readonly #http = inject(HttpClient)
9β
10 getTasks = () => this.#http.get<Array<string>>('/api/tasks')
11β
12 createTask = (task: string) => this.#http.post('/api/tasks', task)
13β
14 deleteTasks = () => this.#http.delete('/api/tasks')
15}