According to the documentation
A function that returns its first argument. This function is useful when writing code in the functional style.
I
Lets say we have these two below functions:
$scope.square = function(n) {
return n * n
};
$scope.multplybyTwo = function(n) {
return n * 2
};
To call this in a functional way:
$scope.givemeResult = function(fn, val) {
return (fn || angular.identity)(val);
};
Then You may use the above function something like below:
$scope.initVal = 5;
$scope.squareResult = $scope.givemeResult($scope.square, $scope.initVal);
$scope.intoTwo = $scope.givemeResult($scope.multplybyTwo, $scope.initVal);
You may follow the below link:
http://litutech.blogspot.in/2014/02/angularidentity-example.html