首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Sammy.js中的手柄部分

Sammy.js中的手柄部分
EN

Stack Overflow用户
提问于 2012-08-17 07:38:29
回答 1查看 1.9K关注 0票数 0

我已经在文档中搜寻sammy.js和handlebars很长时间了,但我终生无法确定http://sammyjs.org/docs/api/0.7.1/all#Sammy.Handlebars (示例2)中的哪个位置指示mypartial.hb加载到{{>hello_friend}}中。想法?

EN

回答 1

Stack Overflow用户

发布于 2017-04-10 22:23:01

我这个问题很老了,但对于所有sammyjs的爱好者来说

代码语言:javascript
复制
var app = $.sammy('#app', function(){

    this.use('Mustache', 'ms');

    this.get('#/hello/:name/to/:friend', function(context){
        this.load('mypartial.ms')
        .then(function(partial){
            context.partials = {hello_friend: partial};
            context.name = context.params.name;
            context.friend = context.params.friend;

            context.partial('mytemplate.ms');
        });
    });
});

http://sammyjs.org/docs/api/0.7.4/all#Sammy.Handlebars注意:版本为0.7.4

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11996951

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档