Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Conventions, strategy, syntax, file extension for external mustache views/templates?

$
0
0
Thanks Tom.  That's a great start and sounds like a good game plan.  Build process is ideal but a little ways down the road.

EDIT: Sorry, check the 1st part.  Just realized we didn't have can.mustache loaded as part of our can package.  Works now!  Keep it in for others.

For some reason I can NOT get my mustache template to render the data.  It renders as the literal string.  For example, inside control init() I have:
  1. var x = can.view( options.view, {userName: 'Joe'} );
  2. console.log ( x );  // frag comes back but without rendered data
And inside external template is:
  1. <h3>Welcome {{ userName }}</h3> 
x is being returned as a docFrag but the text for the h3 is static Welcome {{ userName }}.  Any thoughts on why the data isn't being picked up by the mustache tag?

Also, will a method such as findAll() on a model always return a deferred in order to utilize $.then and $.done?

Viewing all articles
Browse latest Browse all 3491

Trending Articles