0

I try to follow the example 1 from (https://github.com/linkedin/dustjs/wiki/Dust-little-less-know-language-constructs) tutorial. Then I do my testing as below:

partial.tl

{+greeting} Hola {/greeting}
{+world} World {/world}

Main.html

<script type="text/x-template" id="itemTemplate">
{>partial/}
</script>

But it didn't works. If you know how to do partial template, please show me how. Dust.js tutorial / guide is really hard to find on internet.

Thank you.

user1995781
  • 19,085
  • 45
  • 135
  • 236
  • Check this if it helps http://stackoverflow.com/questions/18194366/how-to-pass-partials-to-a-dust-js-template – K D Jun 20 '14 at 11:47
  • @KD Thanks for the link. But I still don't get it works. As I put in `{>partial/}`, my whole template become not working. If you know how, please show to me. Thanks. – user1995781 Jun 21 '14 at 02:21
  • @KD I just found that the problem is Dust.js cannot find `partial.tl`. I tried with `partial.dust`, but it is still the same. I am putting the `partial.tl` in the same directory as `main.html`, and dust.js in the js sub folder. Why is it cannot load? How to fix it? Thanks. – user1995781 Jun 21 '14 at 04:14

1 Answers1

1

Dust has to be compiled to JavaScript before you can execute it. .tl and .dust files are just source forms. If you are in a client environment there is a pretty good explanation here. Basic Example of Client Side Templating with Dust.js

Community
  • 1
  • 1
rragan
  • 484
  • 2
  • 2