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

Exception if checking presence and nothing was passed along #166

Closed
ansman opened this issue Jan 21, 2012 · 2 comments
Closed

Exception if checking presence and nothing was passed along #166

ansman opened this issue Jan 21, 2012 · 2 comments
Labels
Milestone

Comments

@ansman
Copy link

ansman commented Jan 21, 2012

If you do a check like so: {{#if foobar}}{{foobar}}{{/if}}
It only works in you pass something to the template function.

I've created a JSFiddle that shows this behaviour: http://jsfiddle.net/aLpqs/

I think that the context should default to {} if nothing was given.
I don't see how that would break any existing code either.

@spadgos
Copy link
Contributor

spadgos commented Jan 21, 2012

I guess similarly, a template like {{foo.bar}} fails if the foo variable isn't defined.

@ansman
Copy link
Author

ansman commented Jan 22, 2012

Yeah, though this is not as big an issue I think because you can just check if foo is defined first.

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

No branches or pull requests

2 participants