ant45de
ant45de

Reputation: 822

Meteor Blaze.renderWithData(), how to pass functions

I have a Template called dialog:

<template name="dialog">
    <div id='overlay' class='overlay'>
       {{title}}
       {{description}}
    </div>
</template>

and I render it on demand via the blaze function:

    Blaze.renderWithData(Template.dialog,{title:title,description:description,successfcnt:successfcnt,failfnct:failfnct},$("body")[0]);

This works as intended so far. But because its a modal dialog, I want to pass a successfunction and a failurefunction to the template. I want to use these functions in one of the Template.events({...somewhere here...}). How can I access these functions or better call them?

Upvotes: 2

Views: 730

Answers (1)

Radu Chiriac
Radu Chiriac

Reputation: 1424

When using Blaze.renderWithData() accessing the data context can be achieved by simply using this; so in your case I think this.successfcnt(); should do the trick.

Upvotes: 1

Related Questions