簡體   English   中英

Sammy.js中的部分把手

[英]Handlebars partial in Sammy.js

我一直在尋找大量的sammy.js和handlebar的文檔,但是我一生都無法確定在http://sammyjs.org/docs/api/0.7.1/all#中的位置指示Sammy.Handlebars (示例2)mypartial.hb加載到{{> hello_friend}}中。 有想法嗎?

我這個問題很舊,但對於所有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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM