commit
52ff29ca30
9 changed files with 1130 additions and 1646 deletions
43
src/app/services/todo-service.service.ts
Normal file
43
src/app/services/todo-service.service.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TodoServiceService {
|
||||
private toDoList: any;
|
||||
private apiUrl: string;
|
||||
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
this.apiUrl = environment.apiUrl;
|
||||
}
|
||||
|
||||
//consulter toDoList
|
||||
getToDoList(){
|
||||
this.toDoList = this.http.get(`${this.apiUrl}/todolist/team/{team_id}`);
|
||||
return this.toDoList;
|
||||
console.log(this.toDoList)
|
||||
}
|
||||
|
||||
//ajouter une tache
|
||||
addTitle(title:string){
|
||||
this.toDoList.push({
|
||||
title:title,
|
||||
isChecked: false
|
||||
});
|
||||
}
|
||||
// cocher et décocher la checkbox
|
||||
checkOrUnCheckTitle($key: string,flag: boolean){
|
||||
this.toDoList.update($key,{isChecked:flag});
|
||||
}
|
||||
|
||||
//supprimer la tache
|
||||
removeTitle($key : string){
|
||||
this.toDoList.remove($key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue