JSFiddle - React, Tailwind, and code Playground

by partyk1d24

HTML

<div ng-app="myApp" ng-controller="MainCtrl">
    <input type="text" ng-model="inFilter" ng-change="setOption()"></input>
    <select ng-model="selectedOpt" ng-options="opt for opt in options | filter:inFilter"></select>
    <p>Selected = {{selectedOpt === inFilter}}</p>
</div>

JavaScript

angular.module('myApp', []);

function MainCtrl($scope) {
    $scope.options = ['as', 'b', 'c', 'a2'];
    $scope.opt1 = 0;  
    $scope.selectedOpt = $scope.options[0];
    $scope.setOption = function() {
        if($scope.options.indexOf($scope.inFilter)  > -1){
              $scope.selectedOpt = $scope.inFilter
        };
    }
}