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 $on event runs multiple times because it's registered multiple times.
$rootScope.$on('submitBookingDialog', function(){
submitBookingDialog();
});
How can I prevent the submitBookingDialog() to happen more than once?
I found a solution, but I don't know if it's ideal.