AngularJS Built-In filter examples

We need to display output data in some other formats many times . For example: You need to display currency with the number. AngularJS provides many inbuilt filter for this purpose.
AngularJS filters are used to format data in views. “|” symbol is used to apply filter.
AngularJS filter can be applied in two ways

  • On AngularJS directives
  • On AngularJS expressions
Lets see some of inbuilt filters here.

Filter on expressions

uppercase

This filter is used to change format of text to uppercase.

Output: HELLO FROM JAVA2BLOG !!!

lowercase

This filter is used to change format of text to lowercase.

Output:hello from java2blog !!!

currency

This filter is used to format number into currency.

Output:Cost is $500.00

limitTo

limitTo is used to display limited number of charcters

Output:
Hello !!!

date

Date is used to format dates in specific formats

Output:Today ‘s date : 02/04/2016

Filter on directives

orderby

This filter is use to order by column in the table.
Output:

Filter:

It is used to filter data from array or list
Output:
AngularJS filter example

Was this post helpful?

Related Posts

  • Multiline comment in PowerShell
    05 January

    PowerShell – Multiline Comment

    Table of ContentsUsing <# #> TagsUsing Shortcut Keys Using <# #> Tags Use the <# tag at the beginning of comments and the #> tag at the end of comments to create multiline comments in PowerShell scripts. All lines inside the comment block are part of the comments. [crayon-63b77559a84fc602647336/] In programming, we use a comment […]

  • Call PowerShell Script from another Script
    05 January

    Call PowerShell Script from Another Script

    Table of ContentsUsing . OperatorUsing & OperatorUsing Invoke-Expression CmdletUsing Start-Process Cmdlet Using . Operator To call a PowerShell script from another: Create two scripts, Script1.ps1 and Script2.ps1. Use the . operator to call Script2.ps1 from Script1.ps1. [crayon-63b77559a8670215279383/] [crayon-63b77559a8673215849842/] [crayon-63b77559a8674836881556/] [crayon-63b77559a8675536276128/] Both scripts (Script1.ps1 and Script2.ps1) were located in the E:\Test directory. When we ran Script1.ps1, […]

  • awk print $2
    05 January

    awk print $2

    In this tutorial, we will see about what is meant by awk print $2. awk is interpreted programming language. It is very powerful programming language and used for text processing. Awk stands for the names of its authors “Aho, Weinberger, and Kernighan”. awk print $2 As said before, awk can be used for text processing. […]

  • Check if Service is running in PowerShell
    05 January

    Check if Service is Running in PowerShell

    Table of ContentsUsing Get-Service CmdletUse Get-Service Cmdlet with if-else BlockUsing Get-SPServiceApplication Cmdlet Using Get-Service Cmdlet Use Get-Service with the Where-Object cmdlet to check if a particular service is running on our local machine. [crayon-63b77559a8864446664707/] [crayon-63b77559a8867310127024/] If you need to put if condition, then head over to this section . We used the Get-Service cmdlet to […]

  • Run reg file in PowerShell
    05 January

    Run .reg File Using PowerShell

    Table of ContentsUsing Invoke-Item CmdletUsing Start-Process CmdletUsing iex OperatorUsing . OperatorUsing reg import Command Using Invoke-Item Cmdlet Use the Invoke-Item cmdlet to run the .reg file using PowerShell. [crayon-63b77559a8993643117905/] For the above command, Invoke-Item performed its default action, which means it allowed us to execute a .reg file. We can also use it to run […]

  • PowerShell restart Computer
    05 January

    PowerShell – Restart Computer

    Table of ContentsUsing Restart-Computer cmdletUse Restart-Computer cmdlet for Local ComputersUse Restart-Computer cmdlet for Remote ComputerUsing Shutdown CommandUse Shutdown Command for Local ComputersUse Shutdown Command for Remote ComputersExamplesExample 1: Restart local computerExample 2: Restart multiple computersExample 3: Restart remote computer with wait, timeout, delay and for parameters. Using Restart-Computer cmdlet Use the Restart-Computer cmdlet to restart […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.