Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Testing CanJS Web Apps

$
0
0
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? 


Viewing all articles
Browse latest Browse all 3491

Trending Articles