Hello, I am trying to implement routing but it isn’t working for me. I don’t understand why because I am following everything it says in the tutorial.
So my html regarding routing is:
<template name="ApplicationLayout">
<nav>
{{yield "navbar"}}
</nav>
<section>
{{yield "content"}}
</section>
<footer>
{{yield "footer"}}
</footer>
</template>
and my JS is
Router.configure({
layoutTemplate: 'ApplicationLayout',
})
Router.route('/test', function () {
// use the template named ApplicationLayout for our layout
this.layout('ApplicationLayout');
this.render('navbar', {to: 'navbar'});
this.render('test', {to: 'content'});
this.render('footer', {to: 'footer'});
});
But this isn’t being run at all. I can change this code to whatever and it has no effect on the client.
In the console it gives me
Uncaught Error: Can't call non-function: [object Object]
at Spacebars.call (spacebars.js:175)
at Spacebars.mustacheImpl (spacebars.js:106)
at Object.Spacebars.mustache (spacebars.js:110)
at Blaze.View._render (app.js:54)
at Blaze.View.doRender (blaze.js:2027)
at blaze.js:1875
at Function.Template._withTemplateInstanceFunc (blaze.js:3687)
at blaze.js:1873
at Object.Blaze._withCurrentView (blaze.js:2214)
at viewAutorun (blaze.js:1872)
Implying some problem with the rendering
Help would be greatly appreciated