0

私はかなりの時間、sammy.js とハンドルバーのドキュメントを精査してきましたが、私の人生ではhttp://sammyjs.org/docs/api/0.7.1/all# Sammy.Handlebars (例 #2) mypartial.hb は {{>hello_friend}} にロードするように指示されています。アイデア?

4

1 に答える 1

0

私はこの質問は古いですが、すべての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 であることに注意してください

于 2017-04-10T14:23:00.877 に答える