Durandaljs shell无法正确渲染

时间:2013-04-19 20:54:20

标签: durandal

我关注shell.js

define(function (require) {
    var router = require('durandal/plugins/router');

    return {
        router: router,
        activate: function () {
            return router.activate('movies/show');
        }
    };
});

并关注shell.html

<div>
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <ul class="nav" data-bind="foreach: router.visibleRoutes">
                <li data-bind="css: { active: isActive }">
                    <a data-bind="attr: { href: hash }, html: name"></a>
                </li>
            </ul>
        </div>
    </div>

    <div class="container-fluid page-host">
        <!--ko compose: { 
            model: router.activeItem, //wiring the router 
            afterCompose: router.afterCompose, //wiring the router 
            transition:'entrance', //use the 'entrance' transition when switching views 
            cacheViews:true //telling composition to keep views in the dom, and reuse them (only a good idea with singleton view models) 
            }--><!--/ko-->
    </div>
</div>

但是当我运行我的应用程序时,shell.htmlclass="navbar navbar-fixed-top"的第一个div永远不会呈现。我错过了什么?

1 个答案:

答案 0 :(得分:1)

这是一个愚蠢的错误。我非常重视ReSharper。因此,我创建了shell.html,然后点击F6将其移至view文件夹。 Resharper而不是移动,复制文件从而留下旧文件。这一切都在我编辑错误的文件时。现在我有一个shell.html,一切正常。