AngularJS provides Filter to modify data in view. There are different types of filters as per requirement.
uppercase : uppercase filter is used to transform data into upper case.
[/html]
lowercase : lowercase filter is used to transform data into lower case.
[/html]
currency: currency filter is used to transform data into currency format.
[/html]
number : number filter formats a number to string.
[/html]
filter: filter filter works on arrays. It gives subset of given array on the basis of applied filter criteria.
[/html]
orderby: orderby filter is also specific to arrays. orderby filter sorts the array on the basis of given criteria.
];
$scope.setOrderSort = function(x) { //alert('h'); $scope.myOrderType = x; }
});
[/html]
limitTo: limitTo works on arrays and set a limit of specific numbers of elements.
];
$scope.displayNumRecord = function($scope,x) { $scope.displayNum = x; }
});
[/html]
json : json filter is used to convert json object to string.
];
});
[/html]
date : date is used to format date into specified format.
Syntax
{{ date | date : format : timezone }}
Today Date = {{ today | date }}
[/html]
Making Custom filters: We can make our custom filter.
return y.toUpperCase(); /* You can build here your own logic to make custom filter. */ }; }); app.controller('dateControllerCustom', function($scope) { $scope.students = ['ravi', 'raju', 'sanjay', 'dev', 'joo']; });
[/html]
A Noun is the name of a person, place or thing. or Name of anything is noun. For example: Sita…
Misko Hevery, a Google employee, developed AngularJS. First version 1.0 of AngularJS was released in 2012. Now AngularJS is fully…
AngularJS expressions contain operators,literals, and variables. AngularJS expressions can be written inside HTML while JavaScript expressions can't be. AngularJS expressions…
Some sentences are given below. Choose the nouns and mention the type of noun whether they are proper noun, common…
Modules are containers for appication controller. They contain different parts of an application. [html] {{ state + " " +…
Using Directives you can extend HTML attributes. In AngularJS you can define your own directives while it has its own…