I have a list of select-elements and would like to assure that at least one of them has a value selected. I have made a small fiddle,
http://plnkr.co/edit/bLh5Gp7fsLphjX0hcLSB?p=preview
$scope.$watch('vm.list', function(a, b) {
alert('changed');
});
where I illustrated the problem. As seen there, I can a) not make a set value to be selected, and b) there's no event firing when one of the options are changed. I would like a button to be hidden if all of the select-boxes are not having any value, hence my question.
you can use ng-change directive for this
if you want use
$watch
, try this oneplunker