dojo: aspect.after is not working -


guys have been trying since hour. unable figure out why aspect.after/before not being called. code.

 require([ "dojo/aspect", "dojo/on", "dojo/dom", "dojo/domready!" ], function(     aspect, on, registry, dom) {     var callback = function() {     alert("called click");      };    var callback2 = function() {     alert("called click 2");          };    var = {     clicking : on(dom.byid("alertbutton"), "click", callback)      };      aspect.after(my, "clicking", callback2);   }); 

thanks in advance.

maybe confusing usage.

aspect.after or aspect.before, execute additional functions base on methods. not action.

example:

aspect.after(my, "clicking", callback2);

anywhere calling my.clicking() run callback2.

not execute additional function when running on(dom.byid("alertbutton"), "click", callback).

my english not good, simple explain:

function a(){     alert(); }  my.clicking = function(){ a(); }; aspect.after(my, "clicking", callback2);  //equals my.clicking = function(){ a(); callback2(); };  //but not equals function a(){     alert();     callback2(); } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -