How can I pass arbitrary data for rendering in an Ember template?
So we are trying to render custom content to a template.
We have this template:
<div class="modal-container">
<div class="popup modal error">
<header>
<p>Error!</p>
<div class="close" {{action 'closeModal'}}>
<i class="fa fa-close"></i>
</div>
</header>
<div class="content">
{{message}}
</div>
</div>
</div>
.. using this app route:
App.ApplicationRoute = Ember.Route.extend
actions:
displayError: (message) ->
@render 'error-modal',
into: 'application'
outlet: 'error-modal'
model: Ember.Object.create message: message
And in our controller, we call:
@send 'displayError', 'Error message.'
Modal popups are just fine, but no message is displayed. What are we doing wrong?
+3
source to share