-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Bug in checkbox #10662
Comments
Hey, thanks for the bug report =) could you please post a minimal reproduction of your issue to http://plnkr.co or http://jsbin.com? thanks~ |
Hi @caitp , here I create an example for that |
Initialize |
... and you can also remove the |
@LeonardoBraga Got it. So its value should be boolean, not string. Hope it would be more convenient because all of my data are get as string. |
he wants the |
Sure thing, @caitp. He didn't mention the values had to be strings in the beginning, this is why I considered it being the wrong usage, and suggested using |
@caitp Do you mean initialize it like this? But it didn't run properly.
|
@LeonardoBraga Yes, I must use Boolean(go) to convert it to boolean formats. Well, it works fine for me now. Great thanks for your kind help. |
@gaoyuan121 hmmm, you're right. That's weird. lets keep this open so that we can fix that bug. |
@gaoyuan121 The glitch with string values is being caused because the input has both |
when on earth did we add that? but yeah I don't think that's an excuse --- we probably shouldn't allow |
@caitp I can provide a PR for that, if you think it's appropriate. |
no let me do it i haven't solved any problems in this repo for at least a month now =) nah i'm kidding, go for it |
@caitp lol :-) |
@LeonardoBraga Sounds good:) |
I don't understand why we need this fix. What is the need for using |
@caitp and @gaoyuan121 - can you provide the real world use case ? |
It actually doesn't make sense to use ng-checked and ng-model together. I'd be fine with reverting this and updating the docs for ng-checked instead. |
@caitp - can you give a view on reverting this? |
I'm anti-reverting, but I'm pro-shrinking if you can find a way to express it in fewer characters. The API should not be surprising people |
With #10664 landed, it should be safe to close this. If anybody wants to talk about the interactions of ng-model and ng-checked, then please open another issue just for this |
I use checkbox like this:
the default value of parameter "go" is "true", when I un-checked the checkbox,the value of go is still "true" when I use console.log(go) to trace it. And when I check and then un-check it angain, its value changed.
The text was updated successfully, but these errors were encountered: