Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client side templating? #33

Open
srlowe opened this issue Mar 29, 2013 · 2 comments
Open

Client side templating? #33

srlowe opened this issue Mar 29, 2013 · 2 comments

Comments

@srlowe
Copy link

srlowe commented Mar 29, 2013

Love the package, but trying to use the same template on server and client side. Have tried using the visionmedia/ejs client side library, unfortunately it expects a 'foreach' in the template, whereas ejs-locals partial does not. Is there a recommended way to do this, or is client-side support coming?

Thanks.

@RandomEtc
Copy link
Owner

I'm not actively working on any new features but will try to take pull
requests if they don't complicate or confuse things on the node side.

@Vadorequest
Copy link

Using the framework sails.js (https://github.com/balderdashy/sails) you can have shared templates in client/server natively. (managed by sails)
Just put your templates in the assets/linker/templates (use --linker when creating the sails project, see https://github.com/balderdashy/sails-docs/blob/0.9/getting-started.md)

Any template will be automatically available in the client code (in the global JST variable). (If you're using EJS, if not then you'll have to do your own implementation).
That's just a tip, sails is a good framwork, maybe it can help you, maybe not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants