commit
7bed54db11
File diff suppressed because it is too large
Load Diff
|
@ -6,7 +6,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<button class="w-100 btn btn-lg btn-rounded btn-secondary">
|
<button class="w-100 btn btn-lg btn-rounded btn-secondary" (click)="onClickDelete(personne.id)">
|
||||||
Supprimer
|
Supprimer
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-fiche-contact',
|
selector: 'app-fiche-contact',
|
||||||
|
@ -7,8 +7,13 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||||
})
|
})
|
||||||
export class FicheContactComponent implements OnInit {
|
export class FicheContactComponent implements OnInit {
|
||||||
@Input() personne: any;
|
@Input() personne: any;
|
||||||
|
@Output() clickDelete = new EventEmitter();
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
|
|
||||||
|
onClickDelete(numPerson: number){
|
||||||
|
this.clickDelete.emit(numPerson);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,6 @@
|
||||||
<img style="max-height: 12% ; max-width: 12%" src="../../../assets/images/contact-1.png"/>
|
<img style="max-height: 12% ; max-width: 12%" src="../../../assets/images/contact-1.png"/>
|
||||||
<p class="fiche-contact" >{{ personne.prenom }} {{ personne.nom }}</p>
|
<p class="fiche-contact" >{{ personne.prenom }} {{ personne.nom }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="openDetails"><app-fiche-contact [personne]="openDetails"></app-fiche-contact></div>
|
<div *ngIf="openDetails"><app-fiche-contact [personne]="openDetails" (clickDelete)="onClickDelete($event)"></app-fiche-contact></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -69,7 +69,10 @@ export class PageRepertoireComponent implements OnInit {
|
||||||
this.openDetails = personne;
|
this.openDetails = personne;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.repertoireService.deleteContact(contact).subscribe((resp) => {
|
|
||||||
// this.router.navigate(['repertoire/']);
|
onClickDelete(contact: Contact){
|
||||||
// });
|
this.repertoireService.deleteContact(contact).subscribe((resp) => {
|
||||||
|
this.router.navigate(['repertoire/']);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue