Consider the following:
days_week: [
{
selected '',
day: 'mon'
},
{
selected '',
day: 'wed'
},
{
selected '',
day: 'fri'
}
]
Inside my template, I can loop through the days:
Which produces this: mon wed fri
What I now want to do is assign an action, so that upon click it will add a class, and upon clicking again, it will remove the class....
<button class="" >
</button>
However, the following code does not seem to work to (start by adding the class highlight)?
actions: {
toggle: function(day_week){
day_week.set('selected','highlight');
}
}
and I get this error: TypeError: day_week.set is not a function ?
Aucun commentaire:
Enregistrer un commentaire