JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.js"></script>
<div ng-app="myApp" ng-controller="DemoCtrl">
<select ng-model="selectedAction" ng-options="action.display_name for action in actions" ng-change="setCurrentAction(selectedAction)"></select>
<p>Current action : {{currentAction}}</p>
<p>
Count: {{count}}
</p>
</div>
JavaScript
angular.module('myApp', []).controller('DemoCtrl', function ($scope) {
$scope.count= 0
$scope.actions = [{
display_name: "Actions",
type: "unknown"
}, {
display_name: "Mark all incoming voicemails as read",
type: "read"
}, {
display_name: "Mark all incoming voicemails as unread",
type: "unread"
}, {
display_name: "Delete all read incoming voicemails",
type: "delete"
}];
$scope.selectedAction = $scope.currentAction = $scope.actions[0];
$scope.setCurrentAction = function (action) {
$scope.currentAction = action;
$scope.selectedAction = $scope.actions[0];
$scope.count++;
};
});