I'm looking to have a default radio button option checked, but so far my attempts with ng-model
and ng-init
haven't been successful.
Here's my HTML:
<div bindonce ng-repeat="row in results.favorites" style="padding: 0px 10px; white-space: nowrap; border-bottom: 1px solid #efefef; border-top: 1px solid #eee; border-left: 1px solid #efefef;">
<input type="radio" ng-click="setFavoriteDashboard(row.id)" ng-model="selectedRow" name="favRadioSel" style="opacity: 1;" class="pointer"/>
<span bo-text="row.title" style="margin: 10px; position: relative; top: 3px;"></span>
</div>
https://i.sstatic.net/H8tYn.png
This is my JS:
$scope.results = {
favorites: [{
id: "WatchList1",
title: "WatchList1"
}, {
id: "WatchList2",
title: "WatchList2"
}, {
id: "WatchList3",
title: "WatchList3"
}]
};
$scope.selectedRow = "WatchList1";
Check out the demo here: http://plnkr.co/edit/KA9HyQ3bHxJo2Cm9qFm3?p=preview