我是流星和铁路由器的新手。铁路由器的例子不是最新的,不能在github上运行。 我只想做一个简单的路线。 这里是我的/client/index.html使路由器与铁路由器流星
<html>
<head>
<title></title>
</head>
<body>
{{> template1OrTemplate2 depending on url}}
</body>
</html>
<template name="template1">
one
</template>
<template name="template2">
two
</template>
我/lib/router.js:
Router.route('/templateOne', function() {
// renderMyTemplate1 please
});
Router.route('/templateTwo', function() {
// renderMyTemplate2 please
});
怎么可能东西容易这么难找?
铁路路由器是好的,但是,FlowRouter是Meteor生态系统的前进方向。 –
http://meteor-guide.readthedocs.org/en/latest/routing/ –
这是流量路由器的文档https://github.com/kadirahq/flow-router –