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

Does not work: {{ some-component disabled=(not someModel.isDirty) }} #8

Closed
lolmaus opened this issue May 6, 2015 · 4 comments
Closed

Comments

@lolmaus
Copy link

lolmaus commented May 6, 2015

So I'm trying to use ember-truth-helpers with this addon: ember-cli-async-button.

It is a simple component that has a disabled property bound to an attribute.

This works as expected:

Component disabled: {{ async-button disabled=true }}
Component disabled: {{ async-button disabled=(not false) }}

Component enabled: {{ async-button disabled=false }}
Component enabled: {{ async-button disabled=(not true) }}

Bot then I've got an Ember Data model. This also works fine:

Displays "false" or "true": {{ model.isDirty }}

Component enabled or disabled depending on `isDirty` state:
{{ async-button disabled=model.isDirty }}

Now, i'm putting model.isDirty into the not subexpression, and suddenly it's not working!

Displays "false" or "true": {{ model.isDirty }}

Component always enabled, regardless of `isDirty` state:
{{ async-button disabled=(not model.isDirty) }}

dafuq

@jmurphyau
Copy link
Owner

I'll take a look..

I see you've got:

Displays "false" or "true": {{ model.isDirty }}

Try also adding:

Displays "false" or "true": {{ not model.isDirty }}

Make sure that displays what you expect.. It will narrow down the issue a bit more

@lolmaus
Copy link
Author

lolmaus commented May 6, 2015

{{ not model.isDirty }} works as expected.

@lolmaus
Copy link
Author

lolmaus commented May 7, 2015

I have experienced the same problem with an if subexpression, without ember truth helpers.

And I was unable to reproduce the problem with a blank component.

Looks like it's a problem of ember-cli-async-button.

@lolmaus lolmaus closed this as completed May 7, 2015
@lolmaus
Copy link
Author

lolmaus commented May 7, 2015

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