How to use loadPartials properly without renderContext?

84 views
Skip to first unread message

Maciej Mazur

unread,
Oct 10, 2012, 6:26:01 AM10/10/12
to sam...@googlegroups.com
Hey,

When I want to load partials using the loadPartials() at the start of the route execution, I am left with "Sammy.Object: {} has no method 'loadPartials'" error. Shouldn't this method work similary to the load() and automatically run on render context?

I can avoid the problem with weird dummy loads like this:

var app = Sammy('body', function(){

    app.get('#/website/home', function(context){

        this.load('someDummyFileJustToRunRenderContext.ms')
            .loadPartials({
                'heading': 'heading.ms',
                'footer': 'footer.ms'
            })
            .render('realTemplate.ms')
            .swap();

    });

});

But of course this looks like a terrible solution. Shouldn't it work like this:

var app = Sammy('body', function(){

    app.get('#/website/home', function(context){

        this.loadPartials({
                'heading': 'heading.ms',
                'footer': 'footer.ms'
            })
            .render('realTemplate.ms')
            .swap();

    });

});

What am I doing wrong?


Kind regards,
Maciej

Maciej Mazur

unread,
Oct 15, 2012, 3:57:14 AM10/15/12
to sam...@googlegroups.com
Hey,


Thanks
Reply all
Reply to author
Forward
0 new messages