Tuesday, January 30, 2018

Write a program for a filter Filter in angularJS.

  • The filter Filter selects a subset of an array.
  • The filter Filter can only be used on arrays, and it returns an array containing only the matching items.

Program
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
</script>
</head>
<body>
<div ng-app="ABC" ng-controller="DEF">
<ul>
<li ng-repeat="x in  name | filter : 'e'">
{{x}}
</li>
</ul>
</div>
<script>
angular.module("ABC",[]) .controller("DEF",function ($scope)
{
$scope.name=['dave','patel','dabhi','panchal','joe','doge'];
});
</script>
</body>
</html>

Output


0 comments:

Post a Comment

Thanks For Commented.

TechTalk