I have a json file
$scope.favoriteThings = [
{nr: 1, text: "Raindrops on roses"},
{nr: 2, text: "Whiskers on kittens"},
{nr: 3, text: "Bright copper kettles"},
{nr: 4, text: "Warm woolen mittens"},
{nr: 5, text: "Brown paper packages tied up with strings"},
{nr: 6, text: "Cream colored ponies"},
{nr: 7, text: "Crisp apple streudels"},
{nr: 8, text: "Doorbells"},
{nr: 9, text: "Sleigh bells"},
{nr: 10, text: "Schnitzel with noodles"},
{nr: 11, text: "Wild geese that fly with the moon on their wings"},
{nr: 12, text: "Girls in white dresses with blue satin sashes"},
{nr: 13, text: "Snowflakes that stay on my nose and eyelashes"},
{nr: 14, text: "Silver white winters that melt into springs"}
];
-I am using ng-repeat directive to repeat the above array.
<li ng-repeat="thing in favoriteThings">
<input type="radio" value="{{thing}}" ng-model="$parent.selected" name="stuff"/>
{{thing.text}}
</li>
- I am displaying the value obtained by selecting a checkbox as
Selected thing: {{selected}}{{selected.nr}}
- then i get the following output
Selected thing: {"nr":5,"text":"Brown paper packages tied up with strings"}
To acces the "nr" attribute i try to use {{selected.nr}} but that does not work
Any ideas why?
PLUNKER LINK
EDIT: I also want to access the TEXT attribute