简体   繁体   中英

Durandaljs shell is not rendering corectly

I have following shell.js

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

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

and following 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>

But when I run my application, first div in the shell.html having class="navbar navbar-fixed-top" never renders. What am I missing?

This turned out to be a silly mistake. I use ReSharper quite heavily. So I created a shell.html and then hit F6 to move it to view folder. Resharper instead of moving, copied the file thus leaving the old file behind. All this while I was editing the wrong file. Now I have one shell.html and everything works just ok.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM