1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
import {Component, Input, OnInit} from '@angular/core';
import {HttpService} from '../../app.service';
export interface Assets {
name: string;
id: string;
type: string;
}
export interface Groups {
id: string;
key: string;
name: string;
value: string;
parent: string;
assets_granted: Array<Assets>;
}
export class TreeStruct {
id: string;
leafs: Array<TreeStruct>;
static create(id, parent: string) {
const tmp = new TreeStruct();
tmp.id = id;
tmp.leafs = [];
return tmp;
}
}
@Component({
selector: 'elements-tree',
templateUrl: './tree.component.html',
styleUrls: ['./tree.component.scss']
})
export class ElementTreeComponent implements OnInit {
@Input() TreeData: Array<TreeStruct>;
constructor(private _http: HttpService) {
}
ngOnInit() {
}
}