Answer/उत्तर: (B) using pipe (|)
Explanation/व्याख्या: AngularJS uses the pipe |
symbol to apply filters in expressions.
AngularJS में फ़िल्टर जोड़ने के लिए पाइप |
सिंबल का उपयोग किया जाता है।
Types of Filters in AngularJS
Nine Filters (09) का उपयोग डेटा को format करने, छाँटने, या फिल्टर करने के लिए किया जाता है। इन्हें expressions में |
(pipe) के साथ लिखा जाता है।
i. currency- Formats a number into currency format. Example: {{
price | currency }}
→ $500.00
ii. date- Converts a date into a readable format. Example: {{
today | date:'dd/MM/yyyy' }}
→ 06/07/2025
iii. filter- Filters an array based on a condition or keyword. Example: ng-repeat="x
in names | filter:'
OnWeb
'"
iv. json- Converts an object into a JSON string. Example: {{
student | json }}
v. limitTo- Limits the number of items or characters shown. Example: {{
message | limitTo:10 }}
vi. lowercase- Converts a string to lowercase. Example: {{
name | lowercase }}
→ onweb
vii. uppercase- Converts a string to uppercase. Example: {{
name | uppercase }}
→ ONWEB
viii. number- Formats a number with decimals. Example: {{
marks | number:2 }}
→ 89.50
ix. orderBy- Sorts an array based on a field or expression. Example: ng-repeat="x
in students | orderBy:'name'"