Tied schema dropdown to request/response schema samples

This commit is contained in:
Craig Larrabee 2017-08-29 11:25:46 -06:00
parent 06f372d1a8
commit be9df91273
2 changed files with 7 additions and 5 deletions

View File

@ -39,7 +39,7 @@ export class SchemaSample extends BaseComponent implements OnInit {
super(specMgr); super(specMgr);
this.element = elementRef.nativeElement; this.element = elementRef.nativeElement;
this._normalizer = new SchemaNormalizer(specMgr); this._normalizer = new SchemaNormalizer(specMgr);
this.subscription = this._schemaChanger.selectedDescendantChanged$.subscribe( this.subscription = this._schemaChanger.selectedDescendantChanged().subscribe(
descendantInfo => { descendantInfo => {
this.selectDescendant(descendantInfo.idx, descendantInfo.name, descendantInfo.isRequestSchema, descendantInfo.responseCode); this.selectDescendant(descendantInfo.idx, descendantInfo.name, descendantInfo.isRequestSchema, descendantInfo.responseCode);
_cdRef.detectChanges(); _cdRef.detectChanges();

View File

@ -1,7 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject'; import { Subject } from 'rxjs/Subject';
import {DescendantInfo} from "../utils/spec-manager";
@Injectable() @Injectable()
export class SchemaChangerService { export class SchemaChangerService {
@ -10,7 +8,11 @@ export class SchemaChangerService {
private selectedDescendantSource = new Subject<any>(); private selectedDescendantSource = new Subject<any>();
// Observable descendant streams // Observable descendant streams
selectedDescendantChanged$ = this.selectedDescendantSource.asObservable(); private selectedDescendantChanged$ = this.selectedDescendantSource.asObservable();
selectedDescendantChanged() {
return this.selectedDescendantChanged$;
}
// Service message commands // Service message commands
announceDescendantChange(idx: string, descendantName: string, isRequestSchema: boolean, responseCode: string) { announceDescendantChange(idx: string, descendantName: string, isRequestSchema: boolean, responseCode: string) {