javascript - Is there is any work around to get result according to first letter in angucomplete angularjs directive -


i using angularjs directive angucomplete-alt in there possibility results according text first select. here fiddle clear view.

angular.module('myapp', []).filter('myfilter', function(){ return function(input, text){     return input.filter(function(item){         return item.startswith(text);     }); }; });  function myctrl($scope){ $scope.filter_text = 'a'; $scope.items = [     'abc',     'bca'  ]; } 

if person type 'de' dropdown suggesting 'andhra pradesh' instead of 'delhi' because 'andhra pradesh' starts letter 'a'. want search according first letter.

thanks


Comments

Popular posts from this blog

iis - ASP.Net Core CreatedAtAction in HttpPost action returns 201 but entire request ends with 500 -

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -