Can you create a fiddle and maybe make your example smaller? It uses eval which is strange enough. It's hard to tell what is going on.
Sent from my iPhone
Sent from my iPhone
JavaScriptMVC ForumHi Justin Meyer,
richard.udo asked a question "Controller events listeners/triggers are broken in CanJS"
Hey guys, before you use to be able to do this...
$('html').html('<div class="fab">fab</div>');$.Controller('EventSource',{},{});$.Controller('EventDestination',{},{ "{EventSource} boomd1":function() { console.log("booomd1"); }, "{EventSource} boomd2":function() { console.log("booomd2"); }});ed = new EventDestination($('div.fab'));es = new EventSource($('div.fab'));$([eval(EventSource.fullName)]).trigger("boomd1");$([eval(EventSource.fullName)]).trigger("boomd2");How can I do the following with CanJSI have already tried the following without much luck...var EventSource = can.Control.extend("EventSource",{},{ boom:function(){ console.info('aaaaaaaaaaaaaaaaa:',this); can.trigger(this, "zzz"); }});var EventDestination = can.Control.extend("EventDestination",{ '{EventSource} booms':function(){ console.info('booms'); },},{ '{EventSource} boomd':function(){ console.info('boomd'); }, '{es} zzz':function(){ console.info('zzz'); }, '{es} yyy':function(){ console.info('yyy'); }, '{window} foo': function() { console.info('woo'); }});es = new EventSource();ed = new EventDestination();//es.boom();console.info('bbbbbbbb',es);can.trigger(es, "yyy");The problem here is ed has to be defined first before es for the above to work... If anyone can help would be appreciated....ThanksNow, you can also post your response to this by simply replying to this email! Your response will automatically appear on the forum.
You are receiving this email because you are watching the CanJS forum in javascriptmvc. If you do not wish to receive this e-mail notifications in the future, unwatch the CanJS forum here.This e-mail is generated from Zoho service. If you think this is SPAM, please do report to us and we will take immediate action on this. Report spam to abuse@zoho.com Contact us: Zoho, 4900 Hopyard Rd., Suite 310 ,Pleasanton, CA 94588, USA www.zoho.com