I have a base template:
<template name="ApplicationLayout">
{{> yield}}
</template>
and I route templates into it using Iron Router, like so:
Router.configure({
layoutTemplate: 'ApplicationLayout',
notFoundTemplate: 'home'
});
Router.route('/', function () {
this.render('home');
});
Whenever someone arrives at the site, they'll always be shown the agegate
template. Once they click the submit button, I want to change to a different page (home).
Template.agegate.events({
"click #submit": function (event) {
this.render('home');
}
});
The routing actually works (I get to the desired page), but it throws an error:
Uncaught TypeError: undefined is not a function
I'm assuming this is because the this
in this.render('home')
refers to the current template, whereas it needs to refer to the parent template (the ApplicationLayout
template). However I don't know how to do that, or if that's even relevant.
So, how to can I correctly route inside a Template event function?
Hi there my code is quite simple but Id like for the design purposes to keep everything neat , at the moment Im pulling all the description which is like Some could be huge others can be quite small , ...
Hi there my code is quite simple but Id like for the design purposes to keep everything neat , at the moment Im pulling all the description which is like Some could be huge others can be quite small , ...
EDIT, new code based on Mottie's answer: jQuery.tablesorter.addParser({ id: "monetaryValue", is: function (s) { return false; }, format: function (s) { return s.replace('$'...
EDIT, new code based on Mottie's answer: jQuery.tablesorter.addParser({ id: "monetaryValue", is: function (s) { return false; }, format: function (s) { return s.replace('$'...
Sorry, for that (but I´m a regex noob) in js how would one replace the first folder in a url string. Pseudo Code: Replace at start of string: /any-amount-of-characters/ with nothing Examples $...
Sorry, for that (but I´m a regex noob) in js how would one replace the first folder in a url string. Pseudo Code: Replace at start of string: /any-amount-of-characters/ with nothing Examples $...
What are the scenarios when you want to use CDN to load a javascript file? And which files you might want to lazy load. Or perhaps which scripts are the best candidate to be combined and minified? ...
What are the scenarios when you want to use CDN to load a javascript file? And which files you might want to lazy load. Or perhaps which scripts are the best candidate to be combined and minified? ...