Commit 738b5579 authored by Romain DELEAU's avatar Romain DELEAU

fix bug on comment answers + traces on answers

parent 924fa2bd
...@@ -6,15 +6,15 @@ ...@@ -6,15 +6,15 @@
<button mat-button (click)="removeComment(index)">Supprimer</button> <button mat-button (click)="removeComment(index)">Supprimer</button>
</div> </div>
</div> </div>
<div class="form-answers" *ngFor="let answer of comment.answers, let i = index"> <div class="form-answers" *ngFor="let answer of comment.answers, let i = index;trackBy:trackByIdx">
<textarea [disabled]="!answerEditables[i]" [(ngModel)]="comment.answers[i]">Une réponse</textarea> <textarea [disabled]="!answerEditables[i]" [(ngModel)]="comment.answers[i]" (change)="editTrace($event,'answer_['+i+']')">Une réponse</textarea>
<div class="form-comment-buttons"> <div class="form-comment-buttons">
<button mat-button (click)="this.answerEditables[i] = !this.answerEditables[i]">Modifier</button> <button mat-button (click)="this.answerEditables[i] = !this.answerEditables[i]">Modifier</button>
<button mat-button (click)="removeAnswer(i)">Supprimer</button> <button mat-button (click)="removeAnswer(i)">Supprimer</button>
</div> </div>
</div> </div>
<div class="form-newanswer"> <div class="form-newanswer">
<textarea [(ngModel)]="newAnswer"></textarea> <textarea [(ngModel)]="newAnswer" (change)="editTrace($event,'newAnswer')"></textarea>
<div class="form-newanswer-buttons"> <div class="form-newanswer-buttons">
<button mat-button (click)="addAnswer()">Répondre</button> <button mat-button (click)="addAnswer()">Répondre</button>
</div> </div>
......
...@@ -67,6 +67,10 @@ export class CommentComponent implements OnInit { ...@@ -67,6 +67,10 @@ export class CommentComponent implements OnInit {
}); });
} }
trackByIdx(index: number, obj: any): any {
return index;
}
formatTraceTarget(): string { formatTraceTarget(): string {
let res: string = ''; let res: string = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment