I am new to Angular JS and I am trying to create a set of radio buttons. Creating the buttons was the easy part, but I am having problems figuring out how to default select
Try this approach:
angular.module('demoApp', []).controller('DemoController', function ($scope) {
$scope.priceOptions = [
{qty: 1, price: 10, qty_description: 'Descrip 1', discount: '1%', deal_value: 200},
{qty: 2, price: 7, qty_description: 'Descrip 2', discount: '5%', deal_value: 100}
];
$scope.selected = {priceOption: $scope.priceOptions[0]};
});
HTML
- {{ selected.priceOption.price }}
- {{ selected.priceOption.discount }}
- {{ selected.priceOption.deal_value }}