2012-08-16 43 views

回答

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