Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


Example of using filter in an Angular controller:
Question Posted on 31 Jul 2019

Home >> Angular >> Angular FAQ >> Example of using filter in an Angular controller:




Example of using filter in an Angular controller
Below is the example of using filter in an Angular controller and synatx is given below:-
$scope.ListOfBooks = [
{ BookID: 1, Name: "ASP.NET", Price: "600", Level: "I" },
{ BookID: 2, Name: "C#", Price: "1000", Level: "I" },
{ BookID: 3, Name: "VB.NET", Price: "700", Level: "III" },
{ BookID: 4, Name: "Java", Price: "800", Level: "III" },
{ BookID: 5, Name: "Perl", Price: "1000", Level: "II" },
{ BookID: 6, Name: "Cobol", Price: "500", Level: "I" }
];

$scope.ListOfLevel = $scope.ListOfBooks.filter(function (Book) {
return (Book.Level == "III");
});

// This will display "There are 2 Books for Level III."
prompt("", "There are " + $scope.ListOfLevel.length + " books for level III.");
0
0



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Provide name of some inbuilt angular filters ?
What is Transpiling in Angular?
Define the ng-content Directive
Define ng-if directive
Write down 11 main difference between Angular and React?






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |