Skip to content

Instantly share code, notes, and snippets.

@kenhkan
Created September 14, 2012 20:56
Show Gist options
  • Save kenhkan/3724754 to your computer and use it in GitHub Desktop.
Save kenhkan/3724754 to your computer and use it in GitHub Desktop.
exports.* does not effect on-screen elements
$.hide.addEventListener("click", function(e) {
var views = Alloy.createController("views");
views.hide();
});
$.index.open();
<Alloy>
<Window class="container">
<Require src="views" id="views"/>
<Button id="hide">Hide The View</Button>
</Window>
</Alloy>
// Would hide the 'theView' button
$.theView.addEventListener("click", function() { $.theView.hide(); });
// Would *NOT* hide the 'theView' button
exports.hide = function() { $.theView.hide(); };
<Alloy>
<View class="container">
<Button id="theView">The View</Button>
</View>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment