私が作成したルーターは、ナビゲーション モデルを正常に構築しますが、その中でページが読み込まれるたびに更新する必要があるいくつかのバインディングを更新することができませんchildRouter
( app.pageTitle
、app.pageDescription
)。
activate
これらの更新をデュランダルのライフサイクル (イベントのようなもの) にマッピングする方法はありますか?
define([ 'durandal/app', 'plugins/router', 'knockout', 'app' ], function(app, router, ko, app) {
console.log("content start");
var childRouter = router.createChildRouter().makeRelative({
moduleId : 'app/content/pages',
fromParent : true
}).map([ {
route : [ '', 'grid' ],
moduleId : 'grid/index'
}, {
route : 'details/:id',
moduleId : 'details/index'
}, {
route : 'details/tabs/base',
moduleId : 'details/tabs/base'
} ]).buildNavigationModel();
console.log("cms title start");
app.pageTitle(app.i18n('app:modules.content.title'));
app.pageDescription(app.i18n('app:modules.content.subtitle'));
console.log("cms title stop");
return {
router : childRouter
};
});