Breaking

Search Here

06 October 2023

AngularJS Filters

AngularJS Filters

Filters can be added in AngularJS to format data.


AngularJS Filters

AngularJS provides filters to transform data:


currency Format a number to a currency format.

date Format a date to a specified format.

filter Select a subset of items from an array.

json Format an object to a JSON string.

limitTo Limits an array/string, into a specified number of elements/characters.

lowercase Format a string to lower case.

number Format a number to a string.

orderBy Orders an array by an expression.

uppercase Format a string to upper case.


Adding Filters to Expressions

------------------------------

Filters can be added to expressions by using the pipe character |, followed by a filter.


The uppercase filter format strings to upper case:


Example

-----------------

<div ng-app="myApp" ng-controller="personCtrl">

<p>The name is {{ lastName | uppercase }}</p>

</div>



No comments:

Post a Comment

Hello all, if you have any doubt feel free comment

Comments