Created
June 5, 2013 16:03
-
-
Save timanrebel/5715080 to your computer and use it in GitHub Desktop.
Did you know it is possible to create custom XML tags in Alloy and use them?
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
// <<MyElement> becomes Ti.UI.createMyElement, so that doesn't work | |
Ti.UI.createMyElement({ | |
id: 'myId' | |
}); | |
// But give it a namespace and all of a sudden, it is translated to: | |
Sc.UI.createMySecondElement({ | |
id: 'mySecondId' | |
}) | |
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> | |
<MyElement id="myId" /> | |
<MySecondElement ns="Sc.UI" id="mySecondId" /> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very nice! I did not know that.