Hi guys,
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:
- 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>
Now the problem if i use these object with this following code
- 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>
wtf.....are those "@@!!@@" ??? i've tried self.name, this.name also in my template!!!
Any help??? Tnx in advance!!!