How to load dynamic templates in meteor 0.8 version? -


I have the functionality dynamically load the template without using the router package I have two "Registration" and "Login" templates. When I click Login, I will open the login page template, along with the register. I went to solve this code, but did not work.

  & lt; body & gt; {{& Gt; Content}} & lt; / Body & gt; & Lt; Template name = "content" & gt; {{RenderTemplate}} & lt; / Template & gt;   

Content Assistant

  Template.content.helpers ({'renderTemplate': function () {new Handlebars Please help with the solution. Thanks in advance.       

When you upgrade to 0.8, you should have received a URL on a read-only page. Indicates templates no longer return functions and strings:

This car It does not work:

 template> [session (get the current template)] ({dataKey: 'someValue'})   

You can only return the template object. But you will need to change in any way before you call renderTemplate , before the data reference. I can not tell you how, because I do not know what all their data is necessary for their templates.

  Template.co Ntent.helpers ({'renderTemplate': function () {return template [session.get ('current template')]; }});   

Update : {{& gt; RenderTemplate}} as described in the linked page instead of {{renderTemplate}} .

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -