私はそう...Aureliaマルチページアプリ?
Main.ts
import {Aurelia} from 'aurelia-framework'
import environment from './environment';
//Configure Bluebird Promises.
(<any>Promise).config({
warnings: {
wForgottenReturn: false
}
});
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.feature('resources');
if (environment.debug) {
aurelia.use.developmentLogging();
}
if (environment.testing) {
aurelia.use.plugin('aurelia-testing');
}
// PLAYING AROUND - Log to Console the Value of ShowLanding Session Storage
let showLanding = false;
console.log(showLanding);
// let showLanding = sessionStorage.getItem("show_landing");
if (showLanding || showLanding === null) {
aurelia.start().then(() => aurelia.setRoot('landing'));
} else {
aurelia.start().then(() => aurelia.setRoot('blog/blog'));
}
}
ようmain.tsファイルを設定している場合は、私は、私のアプリのルートにある "Landing.html/.TS" ファイルを持っていますこのコードはうまくいくようです。意味、 "showLanding = false"の場合、アプリケーションは "blog.html"ページにロードされ、それが本当であれば、私の "Landing.html"ページにロードされます。
私がしようとしているのは、管理ページを作成することです。いつでもURLにアクセスしました ".... com/admin"私は "admin.html"ページに移動しますセットアップがあります。
フロントエンドが可能ですか?私が知っている以外の方法は、サーバールートからURLと静的なサービスを照合することだけでしょうか?
明らかに、あなたは本当に異なる根を持つ必要がありますか?あなたはルータを内蔵で使うことはできませんでしたか? Hubのドキュメントを参照してください。http://aurelia.io/hub.html#/doc/article/aurelia/router/latest/router-configuration/ – kettch
ここでプッシュ状態の詳細に関するセクションを参照してください:http://aurelia.io /hub.html#/doc/article/aurelia/router/latest/router-configuration/1これにより、foo.com/#/adminの代わりにfoo.com/adminを使用できるようになります –
これは私が設定したものですが、そうではありませんワーキング。私は "サーバー側の構成"が必要だと言っているが、詳しい説明はしていないし、そこで何をする必要があるのか分からない。 ... /#/ adminか.../adminに行くとプッシュ状態がオン/オフになっているかどうかは、そのページに移動する必要がありますが、私の管理ページはルータビューのどこにでも移動します。管理画面に移動するにはどうすればよいですか? –