Skip to content

A simple modal dialog component to use for building modals in Ember.js

Notifications You must be signed in to change notification settings

meelash/ember-modal-component

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Ember.js Modal Skeleton

This is a simple modal dialog component for Ember.js. Modals are created without a state change.

This has been tested with Ember.js v. 1.0.0-rc.3

Usage

  1. Wrap the handlebar template that you want to be the modal's content with the view helper:

     {{#view App.ModalView}}  
       <h1>Hello!!!11!!!</h1>  
     {{#/view}}
    
  2. Add an action to whatever element you want to open the modal dialog:

     <a {{action 'showSaveDialog'}} >Save me!!!</a>
    
  3. Add an event handler on your application route to create and append the dialog:

     App.ApplicationRoute = Ember.Route.extend({
       events: {
         showSaveDialog: function () {
           // assuming your view is call SaveDialogView and your template is called save_dialog
           var dialog = this.container.lookup('view:save_dialog');
           dialog.append();
         }
       }
     });
    

Acknowledgements

chenzihui for the inspiration
stefanpenner for the guidance on new Ember.js patterns

About

A simple modal dialog component to use for building modals in Ember.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%