[ALOY-529] Alloy.createWidget() should recognize the 2nd parameter as either a widget controller name or argument object
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2013-02-23T03:33:40.000+0000 |
Affected Version/s | Alloy 1.0.0 |
Fix Version/s | Alloy 1.1.0, 2013 Sprint 04 |
Components | Runtime |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Unknown |
Created | 2013-02-21T16:11:35.000+0000 |
Updated | 2018-03-07T22:25:54.000+0000 |
Description
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);
Comments
No comments