Filter of AngularJS basic knowledge notes and basic angularjs knowledge
Filters are used to modify data and can be classified into expressions or using pipeline instructions. The following is a list of commonly used filters.
S. No. Name Description
1. Convert uppercase text to uppercase text.
2. Convert lowercase text to lowercase text.
3. Text in the format of currency and currency.
4. The filter filters a subset of the Array Based on the provided standard.
5. sort and sort basic arrays. Capital Filter
Add an upper-case filter to use the MPs queue expression. Here, an upper-case filter is added to print all student names in upper-case letters.
Enter first name:<input type="text" ng-model="student.firstName">Enter last name: <input type="text" ng-model="student.lastName">Name in Upper Case: {{student.fullName() | uppercase}}
Lower case Filter
Add a lower-case Filter Using the MPs queue expression. Add a lower-case filter to print the Student name with lower-case letters.
Enter first name:<input type="text" ng-model="student.firstName">Enter last name: <input type="text" ng-model="student.lastName">Name in Upper Case: {{student.fullName() | lowercase}}
Currency Filter
The expression of the number returned by the coin Filter Using the MPs queue. Here, we have added a filter for printing the cost of currency format.
Enter fees: <input type="text" ng-model="student.fees">fees: {{student.fees | currency}}
Filter
To display only the required topics, we use subjectName as the filter.
Enter subject: <input type="text" ng-model="subjectName">Subject:<ul> <li ng-repeat="subject in student.subjects | filter: subjectName"> {{ subject.name + ', marks:' + subject.marks }} </li></ul>
Sort Filter
To sort topics by TAG, we use orderBy tag.
Subject:
<ul> <li ng-repeat="subject in student.subjects | orderBy:'marks'"> {{ subject.name + ', marks:' + subject.marks }} </li></ul>
Example
The following example shows all the above filters.
TestAngularJS.html
The above is all the content of this article. I hope you will like it.