crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Example of using filter in an Angular controller:
Question Posted on 31 Jul 2019Home >> 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



.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




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?






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap