title: Register event listener only once in AngularJS
body: <p>I'm broadcasting an event from my navbar controller to another controller, but if I initialize  the controller multiple times (when I'm going front and back through the application) the function that executes on my <code>$on</code> event runs multiple times because it's registered multiple times.</p>
  
  <pre><code>$rootScope.$on('submitBookingDialog', function(){
      submitBookingDialog();
  });
  </code></pre>
  
  <p>How can I prevent the <code>submitBookingDialog()</code> to happen more than once?</p>
  
  <p>I found <a href="https://stackoverflow.com/a/18355215/1020551">a solution</a>, but I don't know if it's ideal.</p>