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

Feature Request: {{#unless ...}} #9

Closed
PaulGrimshaw opened this issue Aug 1, 2013 · 3 comments
Closed

Feature Request: {{#unless ...}} #9

PaulGrimshaw opened this issue Aug 1, 2013 · 3 comments

Comments

@PaulGrimshaw
Copy link

Would it be possible to implement handler for {{#unless ...}}, which is an inverse of {{#if ...}}?

In certain situations this can save many nested ifs.

Also, I note that the handler bar docs use {{else}} without a hash tag, where as your version uses the hash. Don't have a huge issue with this, just wanted to check it was "By Design"

@jehugaleahsa
Copy link
Owner

All tags have hashes. I'll think about the inverse tags. Although the code
would be an almost exact copy of the IfTagDefinition.
On Aug 1, 2013 6:25 AM, "Paul Grimshaw" notifications@github.com wrote:

Would it be possible to implement handler for {{#unless ...}}, which is an
inverse of {{#if ...}}?

In certain situations this can save many nested ifs.

Also, I note that the handler bar docs use {{else}} without a hash tag,
where as your version uses the hash. Don't have a huge issue with this,
just wanted to check it was "By Design"


Reply to this email directly or view it on GitHubhttps://github.com//issues/9
.

@PaulGrimshaw
Copy link
Author

True, just realised the following:

{{#if Paid}}{{#else}}Pay Now{{/if}}

is identical to

{{#unless Paid}}Pay Now{{/unless}}

@jehugaleahsa
Copy link
Owner

That is a pretty cool technique. I probably would have never thought of
that.

On Thu, Aug 1, 2013 at 8:47 AM, Paul Grimshaw notifications@github.comwrote:

True, just realised the following:

{{#if Paid}}{{#else}}Pay Now{{/if}}

is identical to

{{#unless Paid}}Pay Now{{/unless}}


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

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

2 participants