Alloy.createWidget()
accepts 3 parameters:
* *id* - the widget id to be created
* *src* - the name of the widget controller to be used
* *args* - the argument object to pass into the widget's controller
It would be nice if the second parameter could also be recognized as the *args* in the case where the developer would like to use the default *src* or "widget". In short, these 2 calls would behave identically, and continue to bahave identically after this improvement:
var args = { customArg: 123, anotherOne: 'hi there' };
// current usage
Alloy.createWidget('com.my.widget', 'widget', args);
// proposed shorter usage
Alloy.createWidget('com.my.widget', args);
No comments