Rework development page: Pre-build, Build, Populate.
[src/xds/xds-server.git] / webapp / src / app / devel / devel.component.ts
1 import { Component } from '@angular/core';
2
3 import { Observable } from 'rxjs';
4
5 import { ConfigService, IConfig, IProject } from "../services/config.service";
6
7 @Component({
8     selector: 'devel',
9     moduleId: module.id,
10     templateUrl: './devel.component.html',
11     styleUrls: ['./devel.component.css'],
12 })
13
14 export class DevelComponent {
15
16     curPrj: IProject;
17     config$: Observable<IConfig>;
18
19     constructor(private configSvr: ConfigService) {
20     }
21
22     ngOnInit() {
23         this.config$ = this.configSvr.conf;
24         this.config$.subscribe((cfg) => {
25             if ("projects" in cfg) {
26                 this.curPrj = cfg.projects[0];
27             } else {
28                 this.curPrj = null;
29             }
30         });
31     }
32 }