mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 05:10:20 +03:00
Tied schema dropdown to request/response schema samples
This commit is contained in:
parent
06f372d1a8
commit
be9df91273
|
@ -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();
|
||||
|
|
|
@ -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<any>();
|
||||
|
||||
// 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});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user