aboutsummaryrefslogtreecommitdiff
path: root/sandbox/TestAppOgnjen/FrontEnd/src/app/shared.service.ts
blob: 501beda0c8618425626186aa91c1b4d64bf914af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Injectable } from '@angular/core';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { Observable } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class SharedService {
readonly APIUrl="http://localhost:5000/api";
  constructor(private http:HttpClient) { }


  getToDoList():Observable<any[]>{
    return this.http.get<any>(this.APIUrl+'/ToDo');
  }
  addToDo(val:any){
    return this.http.post(this.APIUrl+'/ToDo',val);
  }
  updateToDo(val:any,id:any){
    return this.http.put(this.APIUrl+'/ToDo/'+id,val);
  }
  deleteToDo(val:any){
    return this.http.delete(this.APIUrl+'/ToDo/'+val);
  }
}