JSFiddle - React, Tailwind, and code Playground

by pkozlowski_opensource

HTML

<div ng-app ng-controller="MyCtrl">
    <select ng-model="foo" ng-options="currOption for currOption in options"></select>Selected: {{foo}}<br>
    <select ng-model="bar" ng-options="currOption for currOption in options"></select>Selected: {{bar}}
</div>

JavaScript

function MyCtrl($scope) {
    
    $scope.options = ["a", "b", "c", "d", "e", "f"];
    
    $scope.foo = "b";
    $scope.bar = "c";
    
    $scope.$watch('foo', function(fooValue){
        if (fooValue === $scope.bar){
            $scope.foo = 'a';
        }
    });    
    
}