I have an Ember VeteranRoute set up as below. My Veteran model has name, date, info and medal attributes. I would like to access the veteran's name so I can add it to the title tag, as you can see in the activate function.
I can see that logging out this
to the console in the context of the Route reveals the following which contains all the data I would like access to.
How can I access the name attribute from the data above? I have tried various this.Context._data.name
combinations but none seem to work.
app.js VeteranRoute
App.VeteranRoute = Ember.Route.extend({
model: function(params){
return this.store.find("veteran", params.veteran_id);
},
activate: function() {
$(document).attr('title', this.veteran.name);
console.log(this);
}
});