JSFiddle - React, Tailwind, and code Playground

by fresheyeball

HTML

<div ng-app>
    <div ng-controller="chosen">
        <input ng-model="value" ng-click="setFocus()" placeholder="type here"/>
        <div contenteditable="true">
            <div ng-repeat="value in values" tag></div>
        </div>
        <ul ng-show="isFocus">
            <li ng-repeat="option in options | filter:value" ng-bind="option" ng-class="{selected:$i == selectedIndex}"></li>
        </ul>
    </div>
</div>

JavaScript

function chosen($scope){
    $scope.isFocus = false;
    $scope.setFocus = function(){
        $scope.isFocus = true;
    };
    $scope.value = "";
    $scope.options = [
        'hi there',
        'yo',
        'foo'
    ];    
    $scope.selectedIndex = 0;
};