mercredi 3 juin 2015

Retrieving model's property in controller

I have a model which contains a single data but it's inside an array. I want to retrieve this data from inside my controller and making it a property of the controller so I can use it in other controllers. For example :

App.CurrentsubuserController = Ember.ArrayController.extend({

    currentsubuser: function() {
       return this.get('model'); <-------** not working **
    }.property()

});

Basically I want to get the whole associated model so I can access it's datas. What is the syntax I have to use? Thank you




Aucun commentaire:

Enregistrer un commentaire