mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-27 19:13:44 +03:00
21 lines
526 B
TypeScript
21 lines
526 B
TypeScript
'use strict';
|
|
import { Injectable } from '@angular/core';
|
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
|
|
|
@Injectable()
|
|
export class WarningsService {
|
|
public static warnings = new BehaviorSubject<Array<string>>([]);
|
|
|
|
private static _warnings: Array<string> = [];
|
|
|
|
static hasWarnings() {
|
|
return !!WarningsService._warnings.length;
|
|
}
|
|
|
|
static warn(message:string) {
|
|
WarningsService._warnings.push(message);
|
|
WarningsService.warnings.next(WarningsService._warnings);
|
|
console.warn(message);
|
|
}
|
|
}
|