angular.identity(返回函数的参数)

<!DOCTYPE html>
<html lang="en" ng-app="identitytest">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="js/angular.min.js"></script>
</head>
<body ng-controller="con1">
<script>
angular.module('identitytest',[]).controller('con1',function ($scope) {
$scope.fn = function (a,b) {
          //用法
console.log(angular.identity(a)); //可以使a也可以是b 想要哪个写那个
}
$scope.fn(10,2);
})
</script>
</body>
</html>
原文地址:https://www.cnblogs.com/qiudongjie/p/6690386.html