summaryrefslogtreecommitdiffstats
path: root/webapp/src/app/devel/devel.component.ts
blob: ff1212731e1e8c1543c3cfeecf9f35341edb1b61 (plain)
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
import { Component } from '@angular/core';

import { Observable } from 'rxjs';

import { ConfigService, IConfig, IProject } from "../services/config.service";

@Component({
    selector: 'devel',
    moduleId: module.id,
    templateUrl: './devel.component.html',
    styleUrls: ['./devel.component.css'],
})

export class DevelComponent {

    curPrj: IProject;
    config$: Observable<IConfig>;

    constructor(private configSvr: ConfigService) {
    }

    ngOnInit() {
        this.config$ = this.configSvr.conf;
        this.config$.subscribe((cfg) => {
            if ("projects" in cfg) {
                this.curPrj = cfg.projects[0];
            } else {
                this.curPrj = null;
            }
        });
    }
}