Thursday 15 April 2010

web applications - How ember picks up templates -


I am learning amber and i have a question: where should i put my template files? Assume that I'm using the requirejs to make my application modular. If I define my index.html starter kit:

   gt; {{Item}} & lt; / Li & gt; {{/ Every}} & lt; / Ul & gt; & Lt; / Script & gt;   

My app works properly but if I want to move any other file to my index template in my project, say js / Templates / index.html How do I tell Amber, what is the template in that directory? Do I have to use ideas in this matter? The root is the renderTemplate method, but I do not know how to ask the template to take it from the directory:

  define (['amber', 'text! Templates / Index.html html, function (amber, index template) {var index root = amber root extension ({rendertippler: function () {this.render (indexTemplate); // clearly it is not solution, not me Know how to specify index.}, Model: function () [returns [red ',' blue ',' Yellow '];}}); index root;   

Since the string determining the name of the template to provide the renderTemplate method is waiting I do not know how to tell Amber, that the template is actually in any other file, not in the index.html of the application, but in the template / index / P>

basically need.js for your templates There is no need to use the renderTemplate to crack, if you do not need to do extra stuff in your view, then you do not even need to define the ideas you have in addition to your In index.html, you can separate your templates defined in different handler files *. HBS or *. Handlebar and load in this template

    < / P> li>

  1. Hope it helps.

No comments:

Post a Comment