Skip to content

Instantly share code, notes, and snippets.

@jelhan
Created November 28, 2018 22:34
Show Gist options
  • Save jelhan/b9c6d4b4d8dd6bf46365999419d10746 to your computer and use it in GitHub Desktop.
Save jelhan/b9c6d4b4d8dd6bf46365999419d10746 to your computer and use it in GitHub Desktop.
Ember Bootstrap: Open another modal from within an modal
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
showFirstModal: true,
showSecondModal: false,
actions: {
switchModals() {
this.setProperties({
showFirstModal: !this.showFirstModal,
showSecondModal: !this.showSecondModal,
});
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{#bs-modal
open=showFirstModal
}}
first modal
<button onclick={{action "switchModals"}}>Show other modal</button>
{{/bs-modal}}
{{#bs-modal
open=showSecondModal
}}
second modal
<button onclick={{action "switchModals"}}>Show other modal</button>
{{/bs-modal}}
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-bootstrap": "2.3.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment