Weird problem with Meteor. I had been using Template.layout.render to run a javascript function whenever a page loads that uses the layoutTemplate called layout. It was working, firing code whenever the layout template was rendered, but it recently stopped working.
Code example, in layout.js:
Template.layout.created = function() {
alert("created");
}
Template.layout.rendered = function() {
alert("foo");
}
The Template.layout.created works fine (I see its popup). But the Template.layout.rendered does not run at all. No popup, or any other code I put in that block.
Other pages work with their Template.name.rendered code. For example, in index.js:
Template.index.rendered = function() {
alert("index rendered");
}
That works. I see a index rendered popup.
Anyone seen anything like this?
I am using Iron Router, though I doubt the problem is with Iron Router, here is the config:
Router.configure({
layoutTemplate: 'layout',
});
Router.route('/', {
name: 'index',
});