Durandal 多个/嵌套的ApplicationHost

Durandal 多个/嵌套的ApplicationHost,durandal,Durandal,Drupal的Nuget示例非常好,文档也很有用 到目前为止,我们发现index.html包含名为applicationHost的主机: 在视图激活时路由到欢迎模块,因此欢迎视图: 太好了 我现在想弄清楚的是如何嵌套“applicationHost”容器,将视图独立加载到其中一个容器中 一个例子可能是 router.mapNav('settings'); router.mapNav('settings/mailserver'); //but this one render within an i

Drupal的Nuget示例非常好,文档也很有用

到目前为止,我们发现index.html包含名为applicationHost的主机:

在视图激活时路由到欢迎模块,因此欢迎视图:

太好了

我现在想弄清楚的是如何嵌套“applicationHost”容器,将视图独立加载到其中一个容器中

一个例子可能是

router.mapNav('settings');
router.mapNav('settings/mailserver'); //but this one render within an inner container.
router.mapNav('settings/messages'); //but this one render within an inner container.
...
app.setRoot('viewmodels/shell', 'entrance');
因此,settings.html被呈现,其中包含另一个容器,它的viewmodel类似于:

//As restauants view comes in, it sets it's inner view to something
activate: function () {return router.activate('settings/mailserver');} 
与第一个问题相关-如果另一个页面上有指向设置/消息或设置/邮件服务器的链接,如何确保父设置首先可见


非常感谢。

您希望使用视觉合成。 e、 g

请参阅:

我想你在找儿童路由器

你找到了吗?
activate: function () {return router.activate('welcome');}
router.mapNav('settings');
router.mapNav('settings/mailserver'); //but this one render within an inner container.
router.mapNav('settings/messages'); //but this one render within an inner container.
...
app.setRoot('viewmodels/shell', 'entrance');
//As restauants view comes in, it sets it's inner view to something
activate: function () {return router.activate('settings/mailserver');} 
<div>
    <div data-bind="compose:'viewmodels/header'"></div>
</div>