문제

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?

도움이 되었습니까?

해결책

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top