diff --git a/src/app/components/creator/content-list/content-list.component.html b/src/app/components/creator/content-list/content-list.component.html index b82d330acf9218700fd4d0c8a732626e1f39dd14..4c06490567b70110ae54d540f84b052b2f4b40d7 100644 --- a/src/app/components/creator/content-list/content-list.component.html +++ b/src/app/components/creator/content-list/content-list.component.html @@ -34,10 +34,10 @@ </mat-grid-list> <mat-divider></mat-divider> <mat-card-content> - <mat-expansion-panel *ngFor="let content of contents"> + <mat-expansion-panel *ngFor="let content of contents; index as i"> <mat-expansion-panel-header> <mat-panel-title> - {{ content.subject }} + {{ labels[i] }} </mat-panel-title> <button mat-icon-button color="accent" (click)="editContent(content);$event.stopPropagation();" class="editButton"> diff --git a/src/app/components/creator/content-list/content-list.component.ts b/src/app/components/creator/content-list/content-list.component.ts index c483d4e663afde167945ffa2b1e72d68088cd17b..45efdade44854790573e5c2a17e35facc74dafb7 100644 --- a/src/app/components/creator/content-list/content-list.component.ts +++ b/src/app/components/creator/content-list/content-list.component.ts @@ -45,6 +45,8 @@ export class ContentListComponent implements OnInit { labelMaxLength: number; + labels: string[] = []; + constructor(private contentService: ContentService, private roomService: RoomService, private route: ActivatedRoute, @@ -68,8 +70,9 @@ export class ContentListComponent implements OnInit { this.contents = contents; for (let i = 0; i < this.contents.length; i++) { if (this.contents[i].subject.length > this.labelMaxLength) { - this.contents[i].subject = this.contents[i].subject.substr(0, this.labelMaxLength) + '..'; - console.log(this.contents); + this.labels[i] = this.contents[i].subject.substr(0, this.labelMaxLength) + '..'; + } else { + this.labels[i] = this.contents[i].subject; } } @@ -172,6 +175,7 @@ export class ContentListComponent implements OnInit { break; case 'update': this.contents[index] = this.contentCBackup; + this.contentService.updateContent(this.contents[index]).subscribe(); this.translateService.get('content.content-updated').subscribe(message => { this.notificationService.show(message); });