Newer
Older
import { Component, OnInit } from '@angular/core';
import { FileService } from '../../../common/file.service';
import { Unit } from '../../../common/unit';
template: `
PLAYER ALIVE
<mat-tab-group mat-align-tabs="start">
<mat-tab *ngFor="let page of unitJSON.pages; let i = index" label="Seite {{i+1}}">
<app-page [page]="page"></app-page>
</mat-tab>
</mat-tab-group>
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
export class AppComponent implements OnInit {
unitJSON: Unit = {
pages: []
};
async ngOnInit(): Promise<void> {
// const rawUnit = await FileService.loadFile(['.json']);
this.unitJSON = this.exampleUnit;
}
exampleUnit = {
pages: [
{
sections: [
{
elements: [
{
label: 'Label Dropdown',
options: [
'op1',
'op2'
],
type: 'dropdown',
id: 'dummyID',
xPosition: 124,
yPosition: 26,
width: 180,
height: 60,
backgroundColor: 'grey',
fontColor: 'blue',
font: 'Arial',
fontSize: 18,
bold: true,
italic: false,
underline: false
}
],
width: 1200,
height: 200,
backgroundColor: '#FFFAF0'
},
{
elements: [
{
label: 'Button Text',
type: 'button',
id: 'dummyID',
xPosition: 440,
yPosition: 77,
width: 180,
height: 60,
backgroundColor: 'grey',
fontColor: 'blue',
font: 'Arial',
fontSize: 18,
bold: true,
italic: false,
underline: false
}
],
width: 1200,
height: 200,
backgroundColor: '#FFFAF0'
}
],
width: 1200,
height: 550,
backgroundColor: '#FFFAF0'
},
{
sections: [
{
elements: [],
width: 1200,
height: 200,
backgroundColor: '#FFFAF0'
}
],
width: 1200,
height: 550,
backgroundColor: '#FFFAF0'
}
]
};
}