ti-modal
Bootstrap-styled modals for Ember.js. Includes header & button support.
Assumes you are using ember-app-kit (more specifically ember-jj-abrams-resolver)
Installation
Import the initializer before you create your app, e.g.
import Resolver from 'ember/resolver';
import 'ti-modal/initializer';
export default Ember.Application.extend({
Resolver: Resolver['default']
});
Add the open and close actions to your Application Route:
(in routes/application.js
)
import { ModalRoutingMixin } from 'ti-modal';
export default Ember.Route.extend(ModalRoutingMixin, {
... your application-level actions here ...
});
Usage
Create a Modal Controller with:
import {ModalController} from 'ti-modal';
export default ModalController.extend({
header: 'This is the modal header',
buttons: [
{label: 'Cancel', className: 'btn-default pull-left', action: 'close'},
{label: 'Checkout', className: 'btn-default', action: 'checkout'}
]
});
Create a Modal template with:
...and finally trigger a modal with:
TODO
Tests!!
LICENSE
MIT