title: Angular Component On destroy need to check if Data is saved or not and get Confirmation?
body: <p>Before Angular component is getting destroyed I need to get a confirmation from the user to save the changes or Destroy the component. </p>
  
  <p>Things which I tried:</p>
  
  <ol>
  <li><p>tried to use CanDeactivate guard, but in my case the component is not loading from the routing it is loaded as sub component, so that I cannot add canDeactivate Guard to that component.</p></li>
  <li><p>I tried to figure out using onDestroy of the component, but I cannot destroy the component conditionally as it is of type Void, so I cannot get confirmation from the user before destroying the component.</p></li>
  </ol>
  
  <p>Is there any other way that I can get confirmation from user before destroying the component?</p>