mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 02:23:43 +03:00
Propagate external options
This commit is contained in:
parent
50f65f7cfd
commit
27197ffb46
|
@ -17,8 +17,9 @@ import { OptionsService, RedocEventsService } from '../../services/index';
|
||||||
})
|
})
|
||||||
export class Redoc extends BaseComponent implements AfterViewInit {
|
export class Redoc extends BaseComponent implements AfterViewInit {
|
||||||
static appRef: ComponentRef<any>;
|
static appRef: ComponentRef<any>;
|
||||||
|
static _preOptions: any;
|
||||||
|
|
||||||
options: any;
|
public options: any;
|
||||||
|
|
||||||
private element: any;
|
private element: any;
|
||||||
|
|
||||||
|
@ -51,6 +52,8 @@ export class Redoc extends BaseComponent implements AfterViewInit {
|
||||||
constructor(specMgr: SpecManager, optionsMgr:OptionsService, elementRef:ElementRef,
|
constructor(specMgr: SpecManager, optionsMgr:OptionsService, elementRef:ElementRef,
|
||||||
public events:RedocEventsService) {
|
public events:RedocEventsService) {
|
||||||
super(specMgr);
|
super(specMgr);
|
||||||
|
// merge options passed before init
|
||||||
|
optionsMgr.options = Redoc._preOptions;
|
||||||
this.element = elementRef.nativeElement;
|
this.element = elementRef.nativeElement;
|
||||||
//parse options (top level component doesn't support inputs)
|
//parse options (top level component doesn't support inputs)
|
||||||
optionsMgr.parseOptions( this.element );
|
optionsMgr.parseOptions( this.element );
|
||||||
|
|
|
@ -20,9 +20,9 @@ export function init(specUrl:string, options?) {
|
||||||
if (moduleRef) {
|
if (moduleRef) {
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// optionsService.options = options;
|
Redoc._preOptions = options;
|
||||||
// optionsService.options.specUrl = optionsService.options.specUrl || specUrl;
|
options.specUrl = options.specUrl || specUrl;
|
||||||
|
|
||||||
Redoc.showLoadingAnimation();
|
Redoc.showLoadingAnimation();
|
||||||
return SpecManager.instance().load(specUrl)
|
return SpecManager.instance().load(specUrl)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user