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

If tag is not specified.. #31

Open
jokesterfr opened this issue Apr 27, 2012 · 5 comments
Open

If tag is not specified.. #31

jokesterfr opened this issue Apr 27, 2012 · 5 comments

Comments

@jokesterfr
Copy link

..it fails. I tried with a tpl containing {{mytag}} and a json shema {john:"I'm john"}, I got no response from the server (I use the example mentioned on the main page).
It seems simple to correct, but that really harm (I mean if I forget only one string the client never get the data). Would be better if {{mytag}} would be replaced by a blank if not found :) (throwing an error in the server, but not blocking evthg)

Ciao,
Jk.

@raycmorgan
Copy link
Owner

Actually, it should just be printing nothing when it encounters that tag. I will look into this.

@tamsler
Copy link

tamsler commented Jan 11, 2013

Would it make sense to not touch the {{}} if the view doesn't define the tag for it?

e.g.

  • Hello {{foo}}, test {{bar}}
  • {foo:'world'}

... would produce: Hello world, test {{bar}}

maybe this behavior could be configured.

@raycmorgan
Copy link
Owner

Mustache tags are suppose to render blank if their value is not defined. I
would be open to having a way to override this behavior, but the default
needs to be in line with the Mustache spec as to not be a surprise. It
would also be cool to be able to configure it to throw errors on missing
tags, mainly for development purposes.

On Thu, Jan 10, 2013 at 4:49 PM, Thomas Amsler notifications@git.luolix.topwrote:

Would it make sense to not touch the {{}} if the view doesn't define the
tag for it?

e.g.

  • Hello {{foo}}, test {{bar}}
  • {foo:'world'}

... would produce: Hello world, test {{bar}}

maybe this behavior could be configured.


Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-12126921.

@tamsler
Copy link

tamsler commented Jan 11, 2013

As a default it make sense. The specific use-case that I have is:

I need to template an HTML file that uses Mustache tags for two purposes:

  1. AngularJS bindings. These should not be touched by the MU process.
  2. Mustache tags that need to be processed for server side data pre-rendering.

A way to overwrite the default behavior would be greatly appreciated.

@shawnfeldman
Copy link
Contributor

adding my .02, would be great to have an event that notifies you of missed tags.

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

4 participants