|
@@ -5,18 +5,17 @@ import { Subject } from 'rxjs';
|
|
|
providedIn: 'root',
|
|
|
})
|
|
|
export class DetailsService {
|
|
|
- private offcanvasSubject = new Subject<any>();
|
|
|
- offcanvas$ = this.offcanvasSubject.asObservable();
|
|
|
+ private detailsPanelSubject = new Subject<any>();
|
|
|
+ detailsPanel$ = this.detailsPanelSubject.asObservable();
|
|
|
|
|
|
- private closeOffcanvasSubject = new Subject<any>();
|
|
|
- closeOffcanvas$ = this.closeOffcanvasSubject.asObservable();
|
|
|
+ private closePanelSubject = new Subject<any>();
|
|
|
+ closePanel$ = this.closePanelSubject.asObservable();
|
|
|
|
|
|
private resultSubject = new Subject<any>();
|
|
|
result$ = this.resultSubject.asObservable();
|
|
|
|
|
|
- public openOffcanvas(component: any, data: any) {
|
|
|
- // console.log('openOffcanvas', component, data);
|
|
|
- this.offcanvasSubject.next({ component, data });
|
|
|
+ public openPanel(component: any, data: any) {
|
|
|
+ this.detailsPanelSubject.next({ component, data });
|
|
|
}
|
|
|
|
|
|
// Is called from the dynamic component to close the offcanvas
|
|
@@ -24,10 +23,6 @@ export class DetailsService {
|
|
|
// console.log('closePanel', result);
|
|
|
// Is listened to in the host component where the panel was opened, to initiate further steps
|
|
|
this.resultSubject.next(result);
|
|
|
- this.closeOffcanvas();
|
|
|
- }
|
|
|
-
|
|
|
- public closeOffcanvas() {
|
|
|
- this.closeOffcanvasSubject.next('close');
|
|
|
+ this.closePanelSubject.next('close');
|
|
|
}
|
|
|
}
|