longshotlabs / meteor-template-extension

A Meteor package: Replace already defined templates, inherit helpers and events from other templates
https://atmospherejs.com/aldeed/template-extension
MIT License
220 stars 20 forks source link

templateInstance.set() is not a function #56

Closed MohammedEssehemy closed 6 years ago

MohammedEssehemy commented 7 years ago

I read in the README: use template.set(propName, value) to set the value of the first property named propName on the current or an ancestor template instance.

but when trying to run the following code,

      Template.instance().set('someProp', 'someVal');

I get the following error

        TypeError: Template.instance(...).set is not a function

although the getter function is working well:

    Template.instance().get('someProp');
aldeed commented 6 years ago

@MohammedEssehemy I'm not sure if you ever figured this out, but set was added in 4.1.0 I believe, so check in .meteor/versions to make sure you have that version installed. If another package you are using relies on an earlier version, that might have prevented Meteor from pulling in the latest package.