mirror of
https://github.com/Redocly/redoc.git
synced 2025-03-11 05:15:46 +03:00
32 lines
715 B
TypeScript
32 lines
715 B
TypeScript
'use strict';
|
|
|
|
import { SpecManager, RedocComponent, BaseComponent } from '../base';
|
|
import { WarningsService, OptionsService } from '../../services/index';
|
|
|
|
@RedocComponent({
|
|
selector: 'warnings',
|
|
styleUrls: ['./warnings.css'],
|
|
templateUrl: './warnings.html',
|
|
detect: true,
|
|
onPushOnly: false
|
|
})
|
|
export class Warnings extends BaseComponent {
|
|
warnings: Array<string>;
|
|
shown: boolean;
|
|
constructor(specMgr:SpecManager, optionsMgr: OptionsService) {
|
|
super(specMgr);
|
|
this.shown = !optionsMgr.options.suppressWarnings;
|
|
}
|
|
|
|
init() {
|
|
WarningsService.warnings.subscribe((warns) => {
|
|
console.log(warns);
|
|
this.warnings = warns;
|
|
});
|
|
}
|
|
|
|
close() {
|
|
this.shown = false;
|
|
}
|
|
}
|