title: Aurelia popup when refreshing the page not working
body: <p>As we know, we can put a pop up asking if we are sure about refreshing the page when we click the refresh button on the browser. Usually it is done by adding an event listener on onbeforeunload.</p>
  
  <p>However, in my Aurelia application, I try to do that but it's not working.</p>
  
  <p>let's say this is my app.js ( root ModelView ) </p>
  
  <pre><code>export class App {
  
  this.refreshClicked = () =&gt;{ return "Are you sure you want to exit?"; };
  
  attached(){
  window.addEventListener("onbeforeunload", this.refreshClicked);
  }
  </code></pre>
  
  <p>But it is not working, however, if we replace the return statement to <code>console.log("clicked")</code> I can see that the listener works without any problem.</p>
  
  <p>Any help?</p>