私は流星アプリケーションに複数のページを作成しようとしています。流星1.3.1と最新の鉄道ルータを走っています。鉄道ルータは1つのルートでしか動作しません
これは私のmain.jsファイルです。私はhello there!
見ることができますhttp://localhost:3000/home
に移動した場合
Router.route('/home', function() {
this.render('home');
});
Router.route('/register', function() {
this.render('register');
});
は、これが今の私のmain.htmlをファイル
<template name="home">
<h1>Hello there !</h1>
</template>
<template name="about">
<h1>this is an about page!</h1>
</template>
<template name="register">
<h2>Register</h2>
</template>
である。しかし、私はhttp://localhost:3000/register
にナビゲートする場合、私はしかし、 Oops, looks like there's no route on the client or the server for url: "http://localhost:3000/register."
を見ますjsファイルのルートの位置を次のように変更した場合:
Router.route('/register', function() {
this.render('register');
});
Router.route('/home', function() {
this.render('home');
});
この場合、登録ページは機能し、ホームページは表示されません。