Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Radio buttons with tooltips never become inactive after they've been clicked #219

Closed
bholcomb opened this issue Mar 13, 2013 · 4 comments
Closed

Comments

@bholcomb
Copy link

If I have a group of radio button with tooltips, the buttons show inactive until they are clicked, but when another button of the group is clicked, the originally active button does not go inactive.

Here's a plunker that demonstrates the error: http://plnkr.co/edit/21QC5q

cheers,

Bob

@joshdmiller
Copy link
Contributor

Okay, there are two issues here: (1) tooltip positioning, which will be solved with #139; and (2) the active selection.

The problem with (2) is that the tooltip creates a child scope on that element and your ngModel doesn't contain a "." - that is, it's a primitive that just gets overwritten when changed on a child scope. If you use a non-primitive (like an object), it works just fine: http://plnkr.co/edit/O1PUVZ?p=preview.

When using scopes in AngularJS, always use a dot[1].

I'm going to close this as number 1 is a duplicate and number 2 isn't a bug.

[1]: More info on scope inheritance and AngularJS can be found here.

@jc-tzn
Copy link

jc-tzn commented May 16, 2013

Hi guys,

I have a similar problem when creating radio buttons with ng-repeat, I read the explications from the link @joshdmiller posted and this is what I tried from it: http://plnkr.co/edit/4DMnTqVBtGpEkVKJpslP?p=preview but no luck so far.

Would you have any suggestions on where the problems is?

Best,

JC

@pkozlowski-opensource
Copy link
Member

@jc-tzn You should not use interpolate expression for the btn-radio attribute. You should write btn-radio="btn.n" instead of btn-radio="{{btn.n}}": http://plnkr.co/edit/ZUBSofzKVt9XKLJFDV2v?p=preview

Have a look at http://stackoverflow.com/q/16265993/1418796 for more info

@jc-tzn
Copy link

jc-tzn commented May 16, 2013

oh my god it's the second time I misuse the interpolate expression >< thanks for pointing it out !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants