Skip to content

Instantly share code, notes, and snippets.

@ui2code
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save ui2code/77e043d053f568d8fe58 to your computer and use it in GitHub Desktop.

Select an option

Save ui2code/77e043d053f568d8fe58 to your computer and use it in GitHub Desktop.
Disparando eventos em dojo - Dojo 1.8.3
require([
'dojo/_base/declare',
'dojo/Evented'
], function (
declare,
Evented
) {
var MeuModulo = declare([
Evented
], {
constructor: function () {
this.on('add', function () {
alert('add from constructor') ;
})
},
add: function () {
this.emit('add');
}
});
var mm = new MeuModulo();
mm.on('add', function () {
alert('adicionado!');
});
mm.add();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment