"/ b"ルートでバックボーンアプリケーションを提供する必要があり、ルータに問題があります。私はちょうどビューを表示する場合は正常に動作しますが、私のルーターにフックをかけたときに私のルートコントローラ機能は起動しません。マリネットのルータを使用した非インデックスルートパス
ルータ:(発火が確認された)
define('appRouter', ['marionette', 'rootView', 'changePasswordView'], function(Marionette, rootView, changePasswordView) {
return Marionette.AppRouter.extend({
routes: {
'/b/change-password': 'showChangePassword',
'/b': 'showAccountSettings'
},
showChangePassword: function() {
this.showView(new changePasswordView());
},
showAccountSettings: function() {
this.showView(new rootView());
}
});
});
アプリケーションONSTART:
var Application = Marionette.Application.extend({
...
onStart: function(options) {
console.log('on start');
var router = new appRouter(options);
/** Starts the URL handling framework */
if(! Backbone.History.started) Backbone.history.start();
router.initialize();
},
...
});
私が訪れたときhttp://localhost:8080/b
(私のインデックスはすべて集中的な目的のためである)、それは空白のページをレンダリングします。
あなたMarionette.Applicationでルートを登録しているの?あなたはそのコードを投稿できますか? –
それは私がそれを見逃していたかもしれない、onStartは '' 'Application = Marionette.Application.extend({...})' ''クラス拡張子にあります – goofiw