I have an select field with an ng-model
attribute in a tab within ui-bootstrap's tabset. There is also a button on the tab. On click of the button I would like to get the selected value in the model. I tried using
<select ... ng-model="selectedOption"></select>
<button ng-click="buttonClick()">Click</button>
and then in the controller
$scope.buttonClick = function() {
//try to access $scope.selectedOption
}
But that does not seem to contain the value. I tried looking into the $scope
variable and it seems to contain the selectedOption
inside something called $$childTail
Is there any other way to access the selectedOption value or should I change the structure of my view?
I have a Plunker here of what I'm trying to do.