Last active
August 29, 2015 14:10
-
-
Save ui2code/77e043d053f568d8fe58 to your computer and use it in GitHub Desktop.
Disparando eventos em dojo - Dojo 1.8.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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