From be9df9127357c3640e0218b9a6eaa3a2a3037644 Mon Sep 17 00:00:00 2001 From: Craig Larrabee Date: Tue, 29 Aug 2017 11:25:46 -0600 Subject: [PATCH] Tied schema dropdown to request/response schema samples --- lib/components/SchemaSample/schema-sample.ts | 2 +- lib/services/schema-changer.service.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/components/SchemaSample/schema-sample.ts b/lib/components/SchemaSample/schema-sample.ts index e0ff92b2..24e99b28 100644 --- a/lib/components/SchemaSample/schema-sample.ts +++ b/lib/components/SchemaSample/schema-sample.ts @@ -39,7 +39,7 @@ export class SchemaSample extends BaseComponent implements OnInit { super(specMgr); this.element = elementRef.nativeElement; this._normalizer = new SchemaNormalizer(specMgr); - this.subscription = this._schemaChanger.selectedDescendantChanged$.subscribe( + this.subscription = this._schemaChanger.selectedDescendantChanged().subscribe( descendantInfo => { this.selectDescendant(descendantInfo.idx, descendantInfo.name, descendantInfo.isRequestSchema, descendantInfo.responseCode); _cdRef.detectChanges(); diff --git a/lib/services/schema-changer.service.ts b/lib/services/schema-changer.service.ts index 3fd3172e..6a2ff909 100644 --- a/lib/services/schema-changer.service.ts +++ b/lib/services/schema-changer.service.ts @@ -1,7 +1,5 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; -import {DescendantInfo} from "../utils/spec-manager"; - @Injectable() export class SchemaChangerService { @@ -10,11 +8,15 @@ export class SchemaChangerService { private selectedDescendantSource = new Subject(); // Observable descendant streams - selectedDescendantChanged$ = this.selectedDescendantSource.asObservable(); + private selectedDescendantChanged$ = this.selectedDescendantSource.asObservable(); + + selectedDescendantChanged() { + return this.selectedDescendantChanged$; + } // Service message commands announceDescendantChange(idx: string, descendantName: string, isRequestSchema: boolean, responseCode: string) { this.selectedDescendantSource.next({idx:idx, name:descendantName, isRequestSchema:isRequestSchema, responseCode:responseCode}); } -} \ No newline at end of file +}