forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteams.component.ts
More file actions
39 lines (32 loc) · 1015 Bytes
/
teams.component.ts
File metadata and controls
39 lines (32 loc) · 1015 Bytes
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
import { Component, OnInit } from '@angular/core';
import { ymlService } from 'src/app/service/yaml-parser/yaml-parser.service';
import * as yaml from 'js-yaml';
@Component({
selector: 'app-teams',
templateUrl: './teams.component.html',
styleUrls: ['./teams.component.css'],
})
export class TeamsComponent implements OnInit {
YamlObject: any;
teamList: any;
teamGroups: Map<string, string[]> = new Map();
constructor(private yaml: ymlService) {}
ngOnInit(): void {
this.yaml.setURI('./assets/YAML/meta.yaml');
// Function sets column header
this.yaml.getJson().subscribe(data => {
this.YamlObject = data;
console.log(this.YamlObject);
this.teamList = this.YamlObject['teams'];
this.teamGroups = this.YamlObject['teamGroups'];
console.log('teamList', this.teamList);
console.log('teamGroups', this.teamGroups);
});
}
getTeamArray(key: string): string[] {
return this.teamGroups.get(key) || [];
}
unsorted() {
return 0;
}
}