Simple search using AngularJS

Ng-repeat+ng-model, i've updated with a single letter search, only the first names will be displayed. What is a simple search using angularjs How do you make a simple search using angularjs? This script and codes were developed by Hélio Marcondes on 13 January 2022, Thursday.

How do I make an simple search using angularjs?
  1. Simple search using AngularJS Previews
  2. Simple search using AngularJS HTML Codes
  3. Simple search using AngularJS JS Codes
Simple search using AngularJS Previews

Simple search using AngularJS HTML Codes

<!DOCTYPE html>
<html >
<head>
  <meta charset="UTF-8">
  <title>Simple search using AngularJS</title>
  
  
  
  
  
</head>

<body>
  <body ng-app>
<div ng-controller="List">
  <ul>
    <li ng-repeat="name in names | filter: filterSearch">{{name}}</li>
  </ul>
</div>
  
  <div>
    <input type="search" ng-model="search">
  </div>
</body>
  <script src='http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js'></script>

    <script src="js/index.js"></script>

</body>
</html>

Simple search using AngularJS JS Codes

var List = function($scope){
  $scope.names=["Tax", "Tom", "Ralf", "Jerry", "Snow", "Carl"];
  
  function excluirRegex(string){       //Exclude this pattern from search
    return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g);
}
  
   $scope.filterSearch = function(name) {
     if (!$scope.search){      
       return true;
     }else
        var regex = new RegExp('\\b' + excluirRegex($scope.search), 'i');
        return regex.test(name.split(' ')[0]);
    };  
  }
Do you want hide your ip address?Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup.