I am trying the render the template through my js like below

Template.customerclaim({data:""}); 

It was working fine in previous version of meteorjs with the new update it is throwing error Property 'customerclaim' of object #<Object> is not a function.

有帮助吗?

解决方案

If you want to render the result

Have a careful read of this section of the using blaze wiki. In short, what you are doing is no longer allowed so you need to use one of the example workarounds. Also see this related question.

If you want to return a string (e.g. for email templates)

Have a look at this issue. Specifically you can use this:

var toHTMLWithData = function (kind, data) {
  return UI.toHTML(kind.extend({data: function () { return data; }}));
};

To get a string, you can use it like:

var email = toHTMLWithData(Template.customerclaim, {name: 'John Doe'});

I'd recommend watching that issue for changes since this may not work in future versions.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top