Question

Meteor 0.8.0.1 - what I understood from the docs, this minimal app

<head>
  <title>Meteor Routing Test</title>
</head>

<body>
  {{> renderPage}}
</body>

<template name="hello">
  <h1>Hello World!</h1>
</template>

and

Meteor.Router.add({
  '/hi':'hello',
});

should fetch and render the template named hello upon localhost:3000/hi. Instead, the text hello is being rendered into an empty html (i.e. the meteor header is not loaded).

What am I missing?

Was it helpful?

Solution

Add iron-router (-:

mrt add iron-router

And try this:

Router.map(function() {
  this.route('hi', {
    path: '/hi',
    template: 'hello'
  });
});

And change to

<body>
  {{> yield}}
</body>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top