vendredi 25 novembre 2016

How to get property with argument from controller

I want to get the property defined in my controller. I do need a property, cause I am using it also in a template, so please do not suggest me to change my implementation. I am just asking if it is possible.

My Implementation:

export default Ember.ObjectController.extend({
    canNotSave: function(lookup) {
        console.log(lookup);
        if(lookup === true) {
            //.... DO SOMETHING
            return true;
        }
        else {
            return false;
        }
    }.property(),

    actions: {
        close: function() {
          var canNotSave = this.get('canNotSave',true); //<- This is not working
          if(canNotSave)
          {
            //.... DO SOMETHING
          }
        }
    },
});

Is this possible to do something like this? And how?




Aucun commentaire:

Enregistrer un commentaire