I'm trying to remove the title bar component completely from a window created with a call to WindowService.
Here's my custom open method:
openWindow(settings: WindowSettings, closeCallback: any, preventClose: boolean = false, inputData: any = null): WindowRef {
if (preventClose) {
settings.preventClose = (e: any, w: WindowRef) => {
return true;
}
}
let w = this.windowService.open(settings);
let contentInstance = w.content.instance as any;
if (inputData) {
for (const key in inputData) {
const value = inputData[key];
contentInstance[key] = value;
}
}
w.window.instance.resizeStart.subscribe(() => {
//delete w.window.instance.titleBarView
if (w.window.instance.titleBarView)
w.window.instance.titleBarView.el.nativeElement.remove();
});
return w;
}
As you can see, I've found that w.window.instance.titleBarView.el.nativeElement contains the title bar and I can remove it as such, but the problem is that if I try to access the titleBarView property right before the subscribe line, it's always undefined. The title bar disappears when I resize the window, but that's not what I want.
Is there a way I can subscribe to an event (like beforeShow) and have access to it ?
Or any other way to do it would be appreciated.
Thanks.