javascript - Suggestion in text box possible? -


i have input box type text:

<input type="text></input> 

i have list of names:

 $scope.employees = [{     name: "vishnu"  }, {     name: "seenu"  }]; 

now let 2. when type v, should show vishnu suggestion. when type se, should showseenu` suggestion. how can achieved?

populate options of datalist values in $scope.employees data-ng-repeat:

var app = angular.module('myapp', []);  app.controller('mycontroller', function($scope, $http) {    $scope.employees = [{        name: "vishnu"      },      {        name: "seenu"      }];    });
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>  <div ng-app="myapp" ng-controller="mycontroller">    <input type="text" list="names" placeholder="pick name..">    <datalist id="names">      <option  data-ng-repeat="item in employees" value="{{item.name}}">    </datalist>    </div>

good luck!


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -