Hi Guest 1 HomePage 1 Jobs 1 WalkIn 1Articles  

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


  

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

Home >> WEB >> Angular >> 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.");


Other Important Questions
Provide name of some inbuilt angular filters ?
Example of using filter in an Angular controller:







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