I want a View to be hidden on load, then when a user clicks on a link it will display the view. Can someone review my code and let me know what I have done wrong?
App.parentView = Em.View.extend({
click: function() {
App.childView.set('isVisible', true);
}
});
App.childView = Em.View.extend({
isVisible: false
});
Here is the jsfiddle: http://jsfiddle.net/stevenng/uxyrw/5/
I would create a simple
isVisibleBindingto the view you want to hide/show, seehttp://jsfiddle.net/pangratz666/dTV6q/:
Handlebars:
JavaScript:
A note about your naming conventions: classes should be named
UpperCaseand instanceslowerCase. See blog post about this.