-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ng:change broken on 10.5 #692
Comments
The link given for the code is invalid. Results in HTTP 404. |
Thought I might have hit this myself, but got a very simple example working easily: http://jsfiddle.net/pants/pGgCG/ |
(One weird thing in my example is initially neither radio button is checked, even though their ng:model's both point at the same boolean field, and one's value is {{true}} and the other's is {{false}}. It corrects itself once you click one of them. Is this a bug?) |
works for me: http://jsfiddle.net/IgorMinar/pGgCG/14/ |
@IgorMinar Yours exhibits the same behavior. The "not bar" radio button is not selected initially, despite having its "value" attribute match the value of the model variable it's bound to. (Maybe this belongs in a separate issue?) |
@pants: false !== 'false' Wrap the value in quotes, the value defined in the view is considered a string. Sent via Hubroid |
@pants we don't initialize the model from the "value" attr. this is a tough decision we made in 0.10.x, there has been some discussion about it on the mailing list recently with a proposed 3rd party directive that initializes the model. |
@IgorMinar Thanks for the reply. The fiddle in question isn't trying to initialize the model via the "value" attr; it's happy to initialize I looked on the mailing list for the thread you're referring to and couldn't find it. If you could link to it, I'd love to catch up on it. Can you confirm whether @ProLoser's comment is true? I would think {{false}} would not be turned into 'false'. Sorry to derail this ticket. Happy to move discussion elsewhere if appropriate. |
@pants: I talked with @vojtajina and he's currently working on a fix that will address these the input[type=radio] issues. the current limitation is that radio buttons can be bound only to models of type string, so if in your fiddle you change the link in the controller that assigns scope.bar = false to scope.bar = 'false' then the radio button will be initialized properly. this is silly and we think we know how to address it. @vojtajina do we have a issue for this radio button change? can you post it here? |
@pants the mailing list thread was discussing something unrelated. |
Thanks @IgorMinar, the 'false' hack indeed "fixed" it: http://jsfiddle.net/pGgCG/24/. Looking forward to following your progress. |
Here is the issue #816 |
Unless I'm just not using the proper syntax?
http://jsfiddle.net/ProLoser/TeU4Y/
The text was updated successfully, but these errors were encountered: