-
Notifications
You must be signed in to change notification settings - Fork 33
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
passing true or false for an argument #26
Comments
The current behavior is intentional, though I agree that it could seem a bit counter-intuitive. In the template context we are writing "html" which effectively only understands strings, if we want to pass anything else it must be inside curlies. A very similar thing happens with normal HTML attributes (e.g. |
I think the best solution here is:
|
Created ember-template-lint/ember-template-lint#456 to track adding the new linting rule for this. |
The linting rule was created and enabled over in ember-template-lint/ember-template-lint#461. |
I noticed today that passing an argument as
@fade=true
actually results in a string value, i.e."true"
rather than the booleantrue
. I suppose this aligns with the RFC (emberjs/rfcs#311), though it doesn't explicitly mention bools:In order to pass a bool to my component, I need to do
@fade={{true}}
. I'm willing to be that a lot of people will be tripped up on this. I also couldn't find any record of it being discussed in the RFC PR.Is it possible to allow users to directly pass
true
orfalse
without curly brackets? Is that desirable?Perhaps the RFC itself could be amended to clarify this point. While it's technically covered by "Other values", it's probably a common enough case to document explicitly either way. (cc @chancancode)
The text was updated successfully, but these errors were encountered: