I have two problems (maybe because of the same bug):
1.) I can't default check one radio button in my html page. All three radioboxes are unchecked.
2.) In my code the value for selectedValue is always undefined. The other value username works in my code. (But the value of selectedValue works in the "tt" section and will be changed when i click the radio buttons)
HTML Code:
<input class="login__input" type="text" name="username" ng-model="username" placeholder="Username" autocorrect="off" autocapitalize="off">
<div class="radio__box">
<label>
<input type="radio" ng-model="selectedValue" value="value1" checked>
Radio1
</label><br/>
<label>
<input type="radio" ng-model="selectedValue" value="value2">
Radio2
</label><br/>
<label>
<input type="radio" ng-model="selectedValue" value="value3">
Radio3
</label><br/>
<tt>selected = {{selectedValue}}</tt><br/>
</div>
Javascript Code:
var username = $rootScope.username; // works
var selectedValue = $rootScope.selectedValue; // undefined
Any help would be great. Thanks in advance!
$scope.selectedValue?