I want to prevent member to join his own event in my app.
When member click on join button, he has a alert pop up with message.
Hello,
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, this question is a copy of question unsolved in StackOverFlow.
I can give you more informations …
I can see why this question is still unsolved at SO.
Please provide us with a working example. If this specific feature is too complex try to dumb it down. If you still can’t create a working example than at least explain us this specific use case. And what most important tell us what’s going wrong.
Working examples can be found here: http://www.gajotres.net/help-us-help-you-how-to-ask-a-good-ionic-forum-question/
1 Like
As @Gajotres said, it’s difficult to answer from your post, also I’m not sure about how much a beginner you are.
Do you know how to use the debugger in browser? Because your solution could be as simple as setting a breakpoint in your controller and inspecting values of currentuser and hostuser, maybe they are not what you think they are or maybe you should use ===
Something is definitely wrong in the way you use params, have a look at different ways to share data between states in angular-ui router.