NopCommerce プラグインを作成しようとしています。名前付きディレクトリのプラグインのルート ディレクトリ内にアプリ関連のファイルを配置しましたapp
。私のshell.js viewmodel
では、次のようにルートを定義します。
define(['durandal/system', 'durandal/plugins/router', 'service/logger','config'],
function(system, router, logger,config) {
var shell = {
activate: activate,
router: router
};
function activate() {
logger.log('MyProducts Started', null, system.getModuleId(shell), true);
router.map([
{ route: '', moduleId: 'viewmodels/myProducts', title: 'My Products', nav: true },
{ route: 'searchProducts', moduleId: 'viewmodels/searchProduct', title: 'Search Products', nav: true },
{ route: 'addProducts', moduleId: 'viewmodels/addProduct', title: 'Add Product', nav: true }
]).buildNavigationModel();
return router.activate();
}
return shell;
}
);
規則により、モジュールで定義された最初のルートに移動する必要がありますviewmodels/myProducts
が、次のエラーが発生します:
[viewmodels/shell] MyProducts Started system.js:75
[main] No router found Object
Navigation Complete undefined Object
Uncaught TypeError: Cannot read property 'router' of undefined
井戸で頭を叩いています。デフォルト ルートにはなりません (route:'' を使用)。