<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>angular.isFunction</title> </head> <body ng-app="isFunctionExample"> <h1>angular.isFunction</h1> <p> <span>描述:</span><br /> <span>判断参数是否是一个函数</span> </p> <p> <span>使用方法:</span><br /> <span>angular.isFunction(value)</span> </p> <p> <span>参数:</span><br /> <span>value:判断的值</span><br /> </p> <p> <span>返回值:</span><br /> <span>boolean</span> </p> <hr /> <div ng-controller="isFunctioncon"> <div id="test">{{vals}}</div> </div> </body> <script src="../../js/angular.1.3.0.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> angular.module('isFunctionExample', []).controller('isFunctioncon', function($scope) { //var val = document.getElementById('test'); var val = new Function; console.log(angular.isFunction(val)) $scope.vals = angular.isFunction(val); }) </script> </html>