title: Detect route leave in component in Angular
body: <p>Vue router has really useful in-component guard <code>beforeRouteLeave</code>, which is, quoting: "called when the route that renders this component is about to be navigated away from. Has access to this component instance".</p>
  
  <p>Is there something similar in Angular? In short, I'm looking for method, which would be called in component, when user is leaving from it because of route change.</p>