serving the same mustache templates on the server and client

10 views
Skip to first unread message

softprops

unread,
Nov 20, 2012, 11:45:57 AM11/20/12
to musta...@googlegroups.com
What's great about mustache is that is language agnostic. In theory, you should be able to easily reuse the sample templates on the client as you do on the server. What is the current best practices for exposing templates to both ends of the rendering pipeline. I see people embedding templates in javascript to use on the client which makes them very unagnostically accessible on the server. Does anyone here have recommendations on what the best practice for making templates accessible on both ends?

Doug Tangren

unread,
Nov 20, 2012, 11:52:03 AM11/20/12
to musta...@googlegroups.com

On Tue, Nov 20, 2012 at 11:45 AM, softprops <d.ta...@gmail.com> wrote:
What's great about mustache is that is language agnostic. In theory, you should be able to easily reuse the sample templates on the client as you do on the server. What is the current best practices for exposing templates to both ends of the rendering pipeline. I see people embedding templates in javascript to use on the client which makes them very unagnostically accessible on the server. Does anyone here have recommendations on what the best practice for making templates accessible on both ends?

I guess one should always google but one solution is globbing templates in to a js resource as part of your build process - http://posterous.adambard.com/how-to-load-your-mustache-templates-on-the-cl
Reply all
Reply to author
Forward
0 new messages