mardi 26 mai 2015

Set controller property to first model

I want to set a controller property to the first object of the models but can't get the syntax right.

My application route...

model: function(){
    return this.store.find('group');
}

And then in my application controller, I'm trying something like...

activeGroup: function(){
        return this.get('model.firstObject');
    },

I've got a function a little later to set activeGroup to whichever is chosen, but I want it to be set as the first (or any) class by default.

Thanks!




Aucun commentaire:

Enregistrer un commentaire