akdubya / dustjs

Asynchronous templates for the browser and node.js
http://akdubya.github.com/dustjs/
MIT License
1.44k stars 131 forks source link

partials issue #48

Open ymorales opened 12 years ago

ymorales commented 12 years ago

hi, i have to tried to use the partial {>'/templates/noticias.dust.html'/} inside a template but i get this error:

Error: Expected buffer, comment, partial, reference, section or special but "{" found. Archivo de origen: 1 Línea: 1

thanks for the help!!!

soci-viii commented 12 years ago

Hey @ymorales, please check out what code your noticias.dust.html template is generating and use the first argument to it's dust.register call to reference your template. I'm fairly sure the name you've specified, /templates/noticias.dust.html, does not match what it is generating. Thanks.

nistormihai commented 12 years ago

@soci-viii The problem is there:

var compiled = dust.compile("Hello {name}!", "/templates/noticias.dust.html");
dust.loadSource(compiled);
var compiled = dust.compile("{>'/templates/noticias.dust.html'/}", "other");
dust.loadSource(compiled);

or even

var compiled = dust.compile("Hello {name}!", "intro/main");
dust.loadSource(compiled);
var compiled = dust.compile("{>'intro/main'/}", "other");
dust.loadSource(compiled);