我已经在文档中搜寻sammy.js和handlebars很长时间了,但我终生无法确定http://sammyjs.org/docs/api/0.7.1/all#Sammy.Handlebars (示例2)中的哪个位置指示mypartial.hb加载到{{>hello_friend}}中。想法?
发布于 2017-04-10 22:23:01
我这个问题很老了,但对于所有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
https://stackoverflow.com/questions/11996951
复制相似问题