commit
a9970a50eb
3 changed files with 4 additions and 39 deletions
|
@ -15,7 +15,7 @@
|
||||||
(keyup.enter)="addTache(todo.id)"
|
(keyup.enter)="addTache(todo.id)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{{todo}}
|
|
||||||
|
|
||||||
<div class="element" *ngFor="let tache of todo.taches">
|
<div class="element" *ngFor="let tache of todo.taches">
|
||||||
<div class="element-gauche">
|
<div class="element-gauche">
|
||||||
|
|
|
@ -34,32 +34,12 @@ export class ToDoListComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
//this.refreshTodo();
|
|
||||||
this.beforeEditCache = '';
|
this.beforeEditCache = '';
|
||||||
this.casesRestantes=true;
|
this.casesRestantes=true;
|
||||||
this.filter='tous';
|
this.filter='tous';
|
||||||
this.idTodo = 4;
|
this.idTodo = 4;
|
||||||
this.todoTitle = '';
|
this.todoTitle = '';
|
||||||
/* this.todos = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
texte: 'Finish Angular Screencast',
|
|
||||||
etat: false,
|
|
||||||
editing: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
texte: 'Take over world',
|
|
||||||
etat: false,
|
|
||||||
editing: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
texte: 'One more thing',
|
|
||||||
etat: false,
|
|
||||||
editing: false,
|
|
||||||
},
|
|
||||||
]; */
|
|
||||||
}
|
}
|
||||||
//ajouter tache
|
//ajouter tache
|
||||||
|
|
||||||
|
@ -76,23 +56,8 @@ console.log(idTodoList);
|
||||||
this.TodoService.addTache(tache,idTodoList).subscribe((resp)=>{
|
this.TodoService.addTache(tache,idTodoList).subscribe((resp)=>{
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
})
|
})
|
||||||
/* if (this.todoTitle.trim().length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.todos.push({
|
|
||||||
id: this.idTodo,
|
|
||||||
title: this.todoTitle,
|
|
||||||
completed: false,
|
|
||||||
editing: false,
|
|
||||||
});
|
|
||||||
this.todoTitle = '';
|
|
||||||
this.idTodo++; */
|
|
||||||
}
|
}
|
||||||
/* if (contact.nom !== '') {
|
|
||||||
this.repertoireService.addContact(contact).subscribe((resp) => {
|
|
||||||
this.router.navigate(['repertoire/']);
|
|
||||||
}); */
|
|
||||||
|
|
||||||
|
|
||||||
//modifier la tâche
|
//modifier la tâche
|
||||||
|
|
|
@ -25,7 +25,7 @@ export class TodoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
addTache(newtache: Tache,idTodoList:number): Observable<any> {
|
addTache(newtache: Tache,idTodoList:number): Observable<any> {
|
||||||
console.log(newtache);
|
console.log(newtache +'gkggg');
|
||||||
return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
|
return this.http.post(`${this.apiUrl}/taches/add/${idTodoList}`, newtache);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue