2016-02-25

Meteor - How to access template parameters and its data context from within an event, programmatically

Template.TEMPLATE-NAME.events({

    "click .ELEMENT-CLASS" : function( evt, tmp ){
        console.log( tmp.data.PARAMETER-NAME );
        console.log( tmp.data.data.FIELD-NAME );

        // Output the template's entire data object so you can see what I mean...
        console.log(tmp.data);    }

});

No comments:

Post a Comment