I'd like to add a class to a specific HTML element based on whether it's the selected one at the time. It's selected based on the current page.
For some reason, I'm having a hard time finding how to do that.
Is there a hook or an event that I should look for?
Here's my route:
App.OptionRoute = Ember.Route.extend({
model: function(params) {
return this.modelFor('simpleSearch')[params.question_id];
},
actions: {
select: function(optionId) {
console.log("Option Route");
console.log(optionId);
}
}
});
How would I grab params.question_id
and then use that to add the class to my element?
Should this be done in the class for the view instead?
Thanks!