Clicking Text Selects Corresponding Input
This article is just a quick note for some of the things I have forgotten sadly Html but also give an example using AngularJs.
Basic Html Solution
<inputid="1"type="checkbox"/><labelfor="1">TEST</label>
AngularJs Solution
<inputid="{{$index}}"type="checkbox"/><labelfor="{{$index}}"ng-model="field"></label>
Thoughts
If I was going to make this more scalable I would need to guarantee that the id is unique. It might become a problem if I'm using multiple ng-repeats then the index would not be so special in the view , maybe I can do the index plus the number for that particular element.
Resources
Clicking the text to select corresponding radio button - Stack Overflow
http://plnkr.co/edit/llSc8o?p=preview
Basic Html Solution
<inputid="1"type="checkbox"/><labelfor="1">TEST</label>
AngularJs Solution
<inputid="{{$index}}"type="checkbox"/><labelfor="{{$index}}"ng-model="field"></label>
Thoughts
If I was going to make this more scalable I would need to guarantee that the id is unique. It might become a problem if I'm using multiple ng-repeats then the index would not be so special in the view , maybe I can do the index plus the number for that particular element.
Resources
Clicking the text to select corresponding radio button - Stack Overflow
http://plnkr.co/edit/llSc8o?p=preview