1 import { Component } from '@angular/core';
3 import { Observable } from 'rxjs';
5 import { ConfigService, IConfig, IProject } from "../services/config.service";
10 templateUrl: './devel.component.html',
11 styleUrls: ['./devel.component.css'],
14 export class DevelComponent {
17 config$: Observable<IConfig>;
19 constructor(private configSvr: ConfigService) {
23 this.config$ = this.configSvr.conf;
24 this.config$.subscribe((cfg) => {
25 // Select project if no one is selected or no project exists
26 if (this.curPrj && "id" in this.curPrj) {
27 this.curPrj = cfg.projects.find(p => p.id === this.curPrj.id) || cfg.projects[0];
28 } else if (this.curPrj == null && "projects" in cfg) {
29 this.curPrj = cfg.projects[0];