I am working on a application in ember.js . I have an few questions to all of you guys. First lets discuss about my application points and then what problem I am facing in.
After this things I have one module for email this sections to a particular email id in three ways
3.1 Current Section wise email (Means if we drawing in a fire section then If we send email then svg of fire section will send as a form of pdf) (Done)
3.2 At a time all the sections svg content in PDF. (Here my actual problem starts)
In this point all sections email I am getting problem in retrieve all section svg's at a time. Because the current section is already loaded in a view, template with data , But how can I get all the sections template with its drawing data (svg element's).
I created my route like this
emailPDF = Ember.Route.extend({
setupController: function(controller, model)
{
alert("Controller setup");
this.controllerFor('fire').set('model', model);
this.controllerFor('gas').set('model', model);
},
renderTemplate: function() {
this._super();
this.render('fire', { // the template to render
into: 'emailPDF', // the template to render into
outlet: 'fire', // the name of the outlet in that template
controller: 'fire' // the controller to use for the template
});
this.render('gas', {
into: 'emailPDF',
outlet: 'gas',
controller: 'gas'
});
}
});
And the template is like :
<div id="fire_test">
{{outlet 'fire'}}
</div>
<div id="gas_test">
{{outlet 'gas'}}
</div>
Then I transition this route from one controller like this :
this.transitionToRoute('emailPDF');
But here in the allSections template I am getting previous template that I have already open in the place of fire and gas outlet not able to render fire and gas template.
Please tell me if i am doing something wrong...
I believe what you want to do here is something like this... You need to create a route, say HomeAndContact. In this route create a template. You have 2 options here, make the template something like:
{{outlet 'home'}}
{{outlet 'contact'}}
Or you could also just do:
{{render 'home'}}
{{render 'contact'}}
I would advise against the second option because it will be deprecated/is not aligned with what Ember is doing going forward.
To do the first option, you will need to have some code like this in your HomeAndContactRoute:
HomeAndContactRoute = Ember.Route.extend({
setupController: function(controller, model) {
this.controllerFor('home').set('model', model);
this.controllerFor('contact').set('model', model);
},
renderTemplate: function() {
this.render('home', { // the template to render
into: 'homeAndContact', // the template to render into
outlet: 'home', // the name of the outlet in that template
controller: 'home' // the controller to use for the template
});
this.render('contact', {
into: 'homeAndContact',
outlet: 'contact',
controller: 'contact'
});
}
});
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With