Created
August 7, 2013 21:25
-
-
Save tonylukasavage/6178871 to your computer and use it in GitHub Desktop.
potential usage for nested widgets/requires
This file contains 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
<Alloy> | |
<Window> | |
<Widget src="genericContainer"> | |
<Label>hi there</Label> | |
<Label>another label</Label> | |
<Button>and a button</Button> | |
</Widget> | |
</Window> | |
</Alloy> |
This file contains 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
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]); | |
} |
This file contains 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
<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