JSFiddle - React, Tailwind, and code Playground
by KyleMuir
HTML
<body ng-app="demoApp">
<div ng-controller="DemoController">
<div>
<select ng-model="currentlySelected" ng-options="opt as opt.label for opt in options" ng-change="logResult()">
</select>
The value selected is {{ currentlySelected.value }}.
</div>
</div>
</body>
JavaScript
angular.module('demoApp', []).controller('DemoController', function($scope) {
$scope.options = [
{ label: 'one', value: 1 },
{ label: 'two', value: 2 }
];
$scope.currentlySelected = $scope.options[1];
$scope.logResult = function() {
console.log($scope.currentlySelected);
}
});