Last active
November 28, 2016 14:26
-
-
Save jasonkneen/0f09114f4913c00512f9 to your computer and use it in GitHub Desktop.
In the latest TiAlloy you can specify a module tag against the <Alloy> element in XML and this will be used when creating any elements in the view, so you can override, customise etc. The problem is if you want to use multiple commonJS libraries, there's no support in the Alloy Tag -- you'd have to change the module attribute for each element --…
This file contains hidden or 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 o = {}; | |
// include the modules you want - purposely did this as seperate lines so it's easier to comment out modules etc | |
_.extend(o, require("module1")); | |
_.extend(o, require("module2")); | |
_.extend(o, require("module3")); | |
// make available under a single export for use in <Alloy> tag | |
module.exports = o; |
This file contains hidden or 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 module="elements"> | |
<Window> | |
<Label>Hello!</Label> | |
</Window> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it would be nice like: