Single Page Application
router.routes = {
"home": {
rule: /^\/$/
},
"view": {
rule: /^\/view\/([^/]*)$/,
params: ["scream"]
}
};
router.notfound = "notfound";
<template name="main">
{{> Template.dynamic template=getRoute}}
</template>
<template name="home">
...
</template>
<template name="view">
...
</template>
getPath: function(pathname) {
return
pathname ||
Session.get('pathname') ||
location.pathname;
},
setPath: function(path) {
return
Session.set('pathname',
path);
}