From 8acf635e4aac6a51cf501592b94ed798a127843e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de> Date: Tue, 15 Jan 2019 14:06:55 +0100 Subject: [PATCH] Cut answer if too long --- src/app/components/shared/statistic/statistic.component.html | 2 +- src/app/components/shared/statistic/statistic.component.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/components/shared/statistic/statistic.component.html b/src/app/components/shared/statistic/statistic.component.html index bdd22dab8..3c1111d6b 100644 --- a/src/app/components/shared/statistic/statistic.component.html +++ b/src/app/components/shared/statistic/statistic.component.html @@ -11,7 +11,7 @@ </div> </div> <mat-list role="list"> - <mat-list-item role="listitem" *ngFor="let a of answerList">{{a.label}}: {{a.answer}}</mat-list-item> + <mat-list-item role="listitem" *ngFor="let a of answerList">{{a.label}} : {{a.answer}}</mat-list-item> </mat-list> </mat-card> </div> diff --git a/src/app/components/shared/statistic/statistic.component.ts b/src/app/components/shared/statistic/statistic.component.ts index 7cb05fcf5..109d97948 100644 --- a/src/app/components/shared/statistic/statistic.component.ts +++ b/src/app/components/shared/statistic/statistic.component.ts @@ -56,11 +56,10 @@ export class StatisticComponent implements OnInit { this.answerList[i] = new AnswerList(null, null); this.labels[i] = this.label.charAt(i); this.answerList[i].label = this.labels[i]; - this.answerList[i].answer = content.options[i].label; if (content.options[i].label.length > 20) { - this.answers[i] = content.options[i].label.substr(0, 20) + '..'; + this.answerList[i].answer = content.options[i].label.substr(0, 30) + '..'; } else { - this.answers[i] = content.options[i].label; + this.answerList[i].answer = content.options[i].label; } } this.contentService.getAnswer(content.id).subscribe(answer => { -- GitLab