AngularJS - Prevent member to join his own event

I want to prevent member to join his own event in my app. I've test this code :

$scope.joinEvent = function(authData, Event) {
  var currentuser = authData.uid;
  var hostuser = hostid;
    if (currentuser == hostuser) {
  alert("Oups! Tu ne peux pas rejoindre ton propre événement !");
}  else {
               $state.go('tabconfirme/:eventname/:eventdescription/:eventdate/:eventhour/:eventpr   ice/:eventnbguest/:eventpicture/:eventsurname/:eventlat/:eventlng/:eventdistance/:   eventplace/:eventmail/:eventphone');
}
};

Please help me .. Thanks for your time.

PS: I use Ionic with AngularJS.