Last active
August 29, 2015 14:00
-
-
Save petehuang/11386300 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="mainTemplate"> | |
{{#if isPhone}} | |
{{> mobileTemplatePartOne}} | |
{{else}} | |
{{> desktopTemplate}} | |
{{/if}} | |
</template> | |
<template name="mobileTemplatePartOne"> | |
//first half of stuff | |
<a href="{{ pathFor 'mobileTemplatePartTwo' }}">Second Part</a> | |
</template> | |
<template name="mobileTemplatePartTwo"> | |
//second half of stuff | |
</template> | |
<template name="desktopTemplate"> | |
//all the stuff | |
</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.map(function() { | |
this.route('mainTemplate', { | |
path: '/main' | |
}); | |
this.route('mobileTemplatePartTwo', { | |
path: '/main/parttwo', | |
action: function() { | |
if (Meteor.device.isPhone() == false) { | |
Router.go('/main'); | |
} | |
else { | |
this.render(); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment