1 import { Injectable, SecurityContext } from '@angular/core';
2 import { Observable } from 'rxjs/Observable';
3 import { BehaviorSubject } from 'rxjs/BehaviorSubject';
5 import { XDSServerService } from "../services/xdsserver.service";
7 export interface ISdk {
16 export class SdkService {
17 public Sdks$: Observable<ISdk[]>;
19 private _sdksList = [];
20 private current: ISdk;
21 private sdksSubject = <BehaviorSubject<ISdk[]>>new BehaviorSubject(this._sdksList);
23 constructor(private xdsSvr: XDSServerService) {
25 this.Sdks$ = this.sdksSubject.asObservable();
27 this.xdsSvr.getSdks().subscribe((s) => {
29 this.sdksSubject.next(s);
33 public setCurrent(s: ISdk) {
37 public getCurrent(): ISdk {
41 public getCurrentId(): string {
42 if (this.current && this.current.id) {
43 return this.current.id;