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
Post a Comment