Fix modal displaying and add image to application entity.
This commit is contained in:
21
cerberus/src/app/core/services/modal.service.ts
Normal file
21
cerberus/src/app/core/services/modal.service.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Injectable, Type } from "@angular/core";
|
||||
import { BehaviorSubject, Observable } from "rxjs";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ModalService {
|
||||
_modalContent: BehaviorSubject<Type<unknown> | undefined> = new BehaviorSubject<Type<unknown> | undefined>(undefined);
|
||||
|
||||
open(componentClass: Type<unknown>): void {
|
||||
this._modalContent.next(componentClass);
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this._modalContent.next(undefined);
|
||||
}
|
||||
|
||||
get modalContent(): Observable<Type<unknown> | undefined> {
|
||||
return this._modalContent.asObservable();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user