Skip to content
Snippets Groups Projects
Commit 0b867dfc authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Create mat-tab-group with card in every tab to show content and answers

parent 4d786444
1 merge request!151Resolve "Presentation view for lecturers"
Pipeline #24001 failed with stages
in 2 minutes and 28 seconds
<p>
content-presentation works!
</p>
<div fxLayout="column" fxLayoutAlign="start center">
<mat-tab-group>
<mat-tab fxLayoutAlign="center" *ngFor="let content of contents" label="{{content.subject}}">
<mat-card>
<mat-card-content>
<h3>{{content.body}}</h3>
<mat-divider></mat-divider>
<div class="answers" *ngFor="let answer of content.options; let i = index">
<h4>{{labels[i]}} : {{answer.label}}</h4>
</div>
</mat-card-content>
</mat-card>
</mat-tab>
</mat-tab-group>
</div>
mat-tab-group {
width: 100%;
max-width: 800px;
}
.tab-container {
padding: 20px;
}
mat-card {
width: 800px;
max-width: 90%;
margin-top: 20px;
background-color: #fff8e1;
}
h3 {
font-size: 150%;
color: #26a69a;
}
h4 {
padding-top: 10%;
font-size: 120%;
margin: 0px;
}
.answers:last-child {
padding-bottom: 5%;
}
import { ContentChoice } from './../../../models/content-choice';
import { ContentService } from './../../../services/http/content.service';
import { ContentGroup } from './../../../models/content-group';
import { Component, OnInit } from '@angular/core';
@Component({
......@@ -7,9 +10,18 @@ import { Component, OnInit } from '@angular/core';
})
export class ContentPresentationComponent implements OnInit {
constructor() { }
contents: ContentChoice[];
contentGroup: ContentGroup;
labels = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
constructor(private contentService: ContentService) {
}
ngOnInit() {
this.contentGroup = JSON.parse(sessionStorage.getItem('contentGroup'));
this.contentService.getContentChoiceByIds(this.contentGroup.contentIds).subscribe( contents => {
this.contents = contents;
});
}
}
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