I tried this but can.trigger returns the following jquery error: Uncaught TypeError: Cannot read property 'type' of undefined
define(["can"],function(can){
var HelloWorldController = can.Control({
"click":function(div, event){
console.log("div clicked " , div);
}
});
return HelloWorldController;
});
// Another file
require(["controllers/HelloWorldController"],function(HelloWorldController){
var controller = new HelloWorldController("#contentWrapper");
controller.trigger("click"); // does not work
});
Am I doing something incorrect?