I'm using an ember view to render a modal intro my app, currently it looks like this:
views/modal.js
App.ModalView = Ember.View.extend({
tagName: 'div',
classNames: ['modal', 'fade'],
templateName: 'modal',
didInsertElement: function() {
this.$().modal('show');
}
});
controller/application.js
App.ApplicationController = Ember.ArrayController.extend({
showModal: function() {
var modal = App.ModalView.create();
modal.append();
}
});
The modal.hbs template is just some boilerplate html.
I can show the modal just fine when I trigger my showModal function but I haven't been able to remove the view from the DOM after the modal closes, I'm trying to bind to the hidden event but I can't figure out how, can anyone point me in the right direction?