JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-controller="SIController">
<select id="current-command" ng-model="currentCommand"
ng-options="c as c.label for c in availableCommands track by c.id"></select>
<button ng-click="changeSelectedOption()">Select something</button>
{{currentCommand}}
</div>
JavaScript
var myApp = angular.module('myApp', []);
function SIController($scope) {
$scope.availableCommands = [
{id: 'edit', label: 'Edit'},
{id: 'open', label: 'Open'},
{id: 'close', label: 'Close'}
];
$scope.currentCommand = $scope.availableCommands[2];
$scope.changeSelectedOption = function() {
$scope.currentCommand = $scope.availableCommands[1];
};
};