tapquo / Lungo.js

A framework for developers who want to design, build and share cross device applications.
http://lungo.tapquo.com
Other
2.41k stars 567 forks source link

How to use template engine #344

Open ju2pom opened 9 years ago

ju2pom commented 9 years ago

Hello, I'm beginning a web prototype and I d'like to use a template engine like nunjucks. I manage to render some piece of template inside a section's code this way:

load section#browse': function(event) {
  var items = [{ title: "foo", id: 1 }, { title: "bar", id: 2}];
  var res = nunjucks.render('test.html', { tree: items });

  Lungo.dom("#placeholder").html(res);
}

But I don't want to replace an element's inner html, I would prefer to have a template for the html file containing the section. But I don't know how to do it. I tried to replace the section's inner html, but then I got a black view.

I could not find any help about that in the documentation or on the web.

Thanks for any help, Julien.