I have the following code in index.js:
var win = Alloy.createController('foo').getView();
win.open();
win.addEventListener('exampleEvent', function () {
Ti.API.info('Event Run!'); // does not seem to run
});
on foo.js I have the following:
function runEvent() {
$.trigger('exampleEvent');
$.getView().close();
}
// execute runEvent() somewhere later
However, the function in the event listener does not seem to run.
What am I doing wrong?