aurelia で Razor パーシャル (cshtml) を使用する方法を示す非常に役立つ記事を見つけました。ただし、コードを実行することができず、RobEisenberg のコメントから次のことを学びました。
ConventionalViewStrategy.convertModuleIdToViewUrl
廃止されていました。彼は「ViewLocator サービスを使用したい」とコメントしました。私は gitHUb プロジェクトをフォローしましたが、それが MVC5 と Razor Partials の使用に直接関連していることを確認できませんでした。だから私は混乱しています。
これは、aurelia を index.html ではなく Home/Index/Index.cshtml にルーティングするために微調整できることを望んでいた main.js ファイルの例です。
import {LogManager} from "aurelia-framework";
import {ConsoleAppender} from "aurelia-logging-console";
import {ConventionalViewStrategy} from "aurelia-framework";
LogManager.addAppender(new ConsoleAppender());
LogManager.setLevel(LogManager.logLevel.debug);
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
ConventionalViewStrategy.convertModuleIdToViewUrl = function(moduleId){
var moduleName = moduleId.replace("Scripts/", "");
return `./Templates/${moduleName}`;
}
aurelia.start().then(a => a.setRoot("./Scripts/index", document.body));
}
.html テンプレートの代わりに .cshtml を使用するように MVC5 プロジェクトで aurelia を設定する方法を誰か教えてもらえますか? TypescriptとVS2015を使用しています