You can get access to the data with this.getData()
in your action functions:
emailWelcome: function() {
var data = this.getData(); // get a reference to the data object
data.emailTemplate = 'welcomeEmail';
this.render('emailPage');
},
emailContract: function() {
var data = this.getData(); // get a reference to the data object
data.emailTemplate = 'contractEmail';
this.render('emailPage');
}
- be careful not to call
this.data()
, as that will regenerate the data instead of getting you a reference to the already generated data object. - also be careful not to call
this.setData(newData)
within an action as that will invalidate the old data object, initiating a reactivity reload, and lead to an infinite loop!