Say I have a template which displays a view based on a property:
{{#if App.contentsAreVisible}}
{{view ToggleContents}}
{{/if}}
This ar
You could create a hide function on your view which removes the view when the callback is finished, see http://jsfiddle.net/7EuSC/
Handlebars:
JavaScript:
Ember.View.create({
templateName: 'tmpl',
didInsertElement: function() {
this.$().hide().show("slow");
},
_hideViewChanged: function() {
if (this.get('hideView')) {
this.hide();
}
}.observes('hideView'),
hide: function() {
var that = this;
this.$().hide("slow", function() {
that.remove();
});
}
}).append();