Shemesh / angular-popout-window

Angular Popout Child Window
MIT License
11 stars 6 forks source link

How to handle/catch close event #8

Closed ertemmstein closed 2 years ago

ertemmstein commented 2 years ago

Hi, I want to catch close event when pressing X icon on pop-out window, is it possible?

Shemesh commented 2 years ago

you should register to the window close event

ertemmstein commented 2 years ago

thanks for answer, is there a sample code for that, i couldnt able to do that. I pop out and pop-in with this way but cannot register to close event of PopoutWindowComponent:

popOut(popoutComp:PopoutWindowComponent){
    popoutComp.popOut();
    if(popoutComp.isPoppedOut){
      this.hidePopOutIcon = true;
    }
  }

  popIn(popoutComp:PopoutWindowComponent){
    //const { popOutWindow } = popoutComp;
    popoutComp.popIn();
    if(!popoutComp.isPoppedOut){
      this.hidePopOutIcon = false;
    }
  }
Shemesh commented 2 years ago

i mean something like this