Am looking at the Canjs Sample for Control.
TaskStriker = can.Control({
"{task} completed": function(){
this.update();
},
update: function(){
if ( this.options.task.completed ) {
this.element.addClass( 'strike' );
} else {
this.element.removeClass( 'strike' );
}
}
});
var taskstriker = new TaskStriker({
task: new Task({ completed: 'true' })
});
In this case what is the Task object exactly?. I tried creating the Task with the can.Construct but it is not triggering the update function when value is changed.
Can some one please explain a bit on this?.