I'm having problem using mustache in my application. I've stolen 'can.....mustache' and I've a Model object with this structure:
// widgets
Models.LayoutWidget = can.Model({
findAll: 'GET /pages/{id}/layouts/widgets'
}, {});
Then with a fixture helper it grab these correctly:
var LAYOUT_WIDGETS = [
{
id: 1,
name: 'Menu',
config: {
width: 4,
height: 1
}
}
];
and that's the template:
<script id="layout-widget-template" type="text/mustache">
<li class="layout-widget" {{data 'widget'}}>
<span class="layout-widget-delete">×</span>
<span class="layout-widget-name">{{name}}</span>
</li>
</script>
and that's the code i use to get the template:
var template = can.trim(can.view.render('#layout-widget-template', widget));
// or
var template = can.trim(can.view('#layout-widget-template', widget));
// or same without trim
it just gives me
<li class="layout-widget" data-view-id='2'>
<span class="layout-widget-delete">×</span>
<span class="layout-widget-name"><span data-view-id='3'>@@!!@@</span></span>
</li>
what the.....are those "@@!!@@" ??? it also dont bind data correctly because if i try
can.data(el, 'widget'); // gives undefined!!
I've other templates in my page that works correctly with those widgets items. Its driving me crazy!! i've tried {{self.name}}, {{this.name}} also in my template!!! Any help??? Tnx in advance!!!