mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +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);
|
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();
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user