Created
February 12, 2014 18:31
-
-
Save yeputons/8961667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="layout"> | |
<p>Current page = {{currentPage}}</p> | |
<p><a href="/">Main</a></p> | |
<p><a href="/notfound">Not found</a></p> | |
{{yield}} | |
</template> | |
<template name="main"> | |
<p>Main page</p> | |
</template> | |
<template name="not_found"> | |
<p>Not found page</p> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router.configure({ | |
layoutTemplate: 'layout', | |
notFoundTemplate: 'not_found', | |
}); | |
Router.route('main', {path: '/'}); | |
if (Meteor.isClient) { | |
Template.layout.helpers({ | |
currentPage: function() { | |
if (!Router.current()) | |
return '<not-found>'; | |
return Router.current().template; | |
} | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"packages": { | |
"iron-router": {} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"meteor": {}, | |
"dependencies": { | |
"basePackages": { | |
"iron-router": {} | |
}, | |
"packages": { | |
"iron-router": { | |
"git": "https://github.com/EventedMind/iron-router.git", | |
"tag": "v0.6.2", | |
"commit": "ce56e58b45624dce992490f3a1c10f10d3948bae" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment