ember.js - How to pass arbitrary data to render in an Ember template? -
so we're trying render custom content template.
we have 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>
.. application 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're calling:
@send 'displayerror', 'error message.'
the modal pops fine, message isn't being rendered. doing wrong?
you use common controller (to template , modal) setting error message:
displayerror: (message) -> @controller.set('errormessage', message) @render 'error-modal', into: 'application' outlet: 'error-modal'
in template: {{errormessage}}
.
Comments
Post a Comment