车把部分在萨米.js

Handlebars partial in Sammy.js

本文关键字:js      更新时间:2023-09-26

我一直在文档中搜索 sammy.js 和车把,我一生都无法确定 http://sammyjs.org/docs/api/0.7.1/all#Sammy.Handlebars(示例 #2)mypartial.hb 被指示加载到 {{>hello_friend}} 中的哪个位置(示例 #2)。想法?

我这个问题

很老,但对于所有 Sammyjs 爱好者来说

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

相关文章:
  • 没有找到相关文章