Skip to content

Instantly share code, notes, and snippets.

@tonylukasavage
Created August 7, 2013 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonylukasavage/6178871 to your computer and use it in GitHub Desktop.
Save tonylukasavage/6178871 to your computer and use it in GitHub Desktop.
potential usage for nested widgets/requires
<Alloy>
<Window>
<Widget src="genericContainer">
<Label>hi there</Label>
<Label>another label</Label>
<Button>and a button</Button>
</Widget>
</Window>
</Alloy>
var args = arguments[0] || {};
// assuming Alloy now passes a "children" argument to the widget/require
var children = args.children || [];
for (var i = 0; i < children.length; i++) {
$.container.add(children[i]);
}
<Alloy>
<Label>some label that won't affect the incoming children</Label>
<View id="container"/>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment