mardi 30 juin 2015

EmberJs Return Boolean from Function

I have the following code located in a route. It should create a discussion if it does not exist.

Although discussionAlreadyExist() is called, the code never executes inside the if statement even though the condition is matched.

actions: {
  createDiscussion: function(){
     var self = this;
     if(!self.discussionAlreadyExist()){
        //creatediscussion - why is this code is not being called ?
     }
  }
},

 discussionAlreadyExist: function(){
         return false;
  }




Aucun commentaire:

Enregistrer un commentaire