Need to pass a value from component template to component

Does this help clear things up?

http://emberjs.jsbin.com/lidisumo/11/edit

In short I think you should do this in your template:

{{#modal-dialog action="close" titleTranslation="modal.title"}}
  <h3 class="flush--top">Name Change Modal</h5>
{{/modal-dialog}}

Make sure that there is a translation defined for “modal.title”. Mix-in the library in your component:

export default Ember.Component.extend(Em.I18n.TranslateableProperties, {
  actions: {
    close: function() {
      return this.sendAction();
    }
  }
});

And then just reference title in your template.

<div class="overlay" {{action "close"}}>  </div> 
<div class="modal">
   <div class="title"> {{title}}</div>   
   <div>{{yield}</div>   
</div>
1 Like