0

How to create a link to another page in hot towel ?

I know that to add a link to the menu, I have to add it here :

function boot() {
    router.mapNav('home');
    router.mapNav('details');
    router.mapNav('about');
    log('Hot Towel SPA Loaded!', null, true);
    return router.activate('home');
}

But how to link to one of these links from an html page ?

4

2 回答 2

1

在您的应用程序中,您的链接将类似于:

<a href='#/details'>go to details</a>

否则,您可以从视图模型中使用 Durandal:

router.navigateTo('#/details');
于 2013-05-23T07:21:06.163 回答
1

例如,如果要添加 Session Link,请在 App/viewmodel/session.js 中添加 javascript 文件,然后在 App/views/session.html 中添加 html 文件,然后在 shell.js 中

 function boot() {
        router.mapNav('home');
        router.mapNav('details');
        router.mapNav('session');
        log('Hot Towel SPA Loaded!', null, true);
        return router.activate('home');
    }
于 2013-05-17T13:17:19.427 回答