This means you can ignore the "flatui-radio.js" file and just use plain angular. Not had any problems so far.
Last active
December 19, 2015 17:39
-
-
Save petehamilton/5993366 to your computer and use it in GitHub Desktop.
FlatUI Radio Button Directive for AngularJS
I'm having trouble getting it working properly as well. I just can't get back the model values back into the main scope
Finally we got it working. A good help was this GIST
We have just copied this code here into an own directive called fuiradio
. Than you can include it in any partials like:
If you want to use simple strings in label and value (obey the single quotes):
<fuiradio
label="'Some Label'"
model="your_model_name"
value="'some_value_string'">
</fuiradio>
Or if you want to use dynamic labels and values:
<fuiradio
label="label_variable_name"
model="your_model_name"
value="value_variable_name">
</fuiradio>
Hope this helps!
@jules-winnfield Thanks! Just got it working myself through the same GIST post.
How are you guys using the value and model of the directive? Right now, I have my value inverting the value of the model which is the only way to get the radio to update.
Controller:
$scope.thing = {"name": "thing1", "id": 1, "selected": true};
View:
<fui-radio
model="thing.selected"
label="thing.name"
value="!thing.selected"
required="true"
name="valcontainer2">
</fui-radio>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you please provide a working example in a view? Do you just use an input w/ the directive flatui-radio-button?