1

I did simple search in angularjs using filter. I didn't get expected out come.

Case: User may enter a word with 'o' result should be included 'ö' like this char.

Please help me to get it solved.

angular.module('myApp', []).controller('namesCtrl', function($scope) {
  $scope.names = [
    'Jani',
    'Carl',
    'Margareth',
    'Hege',
    'ö',
    'o',
    'O',
    'Mary',
    'Kai'
  ];
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<div ng-app="myApp" ng-controller="namesCtrl">

  <p>Type a letter in the input field:</p>

  <p><input type="text" ng-model="test"></p>

  <ul>
    <li ng-repeat="x in names | filter:test">
      {{ x }}
    </li>
  </ul>

</div>


<p>The list will only consists of names matching the filter.</p>
phuzi
  • 12,078
  • 3
  • 26
  • 50
mansoor
  • 1,553
  • 1
  • 13
  • 18

1 Answers1

0

http://fusejs.io/ meet my requirements. Thanks all.

mansoor
  • 1,553
  • 1
  • 13
  • 18