Skip to content

Instantly share code, notes, and snippets.

@oozzal
Created March 13, 2016 08:12
Show Gist options
  • Save oozzal/6ea286fa34ca1fc01432 to your computer and use it in GitHub Desktop.
Save oozzal/6ea286fa34ca1fc01432 to your computer and use it in GitHub Desktop.
Ember Simple Bootstrap Modal Component
import Ember from 'ember';
export default Ember.Component.extend({
didInsertElement: function() {
var self = this;
this.$('.modal')
.modal('show')
.on('hide.bs.modal', function() {
self.sendAction('onModalClose');
});
}
});
= bootstrap-modal onModalClose="closeModal"
.modal.fade role='dialog'
.modal-dialog
...
import Ember from 'ember';
export default Ember.Route.extend({
model(params) {
return {};
},
actions: {
closeModal: function() {
this.transitionTo('application');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment