<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>angular.isElement</title> </head> <body ng-app="isElementExample"> <h1>angular.isElement</h1> <p> <span>描述:</span><br /> <span>判断参数是否是一个dom元素(或用jquery元素)</span> </p> <p> <span>使用方法:</span><br /> <span>angular.isElement(value)</span> </p> <p> <span>参数:</span><br /> <span>value:判断的值</span><br /> </p> <p> <span>返回值:</span><br /> <span>boolean</span> </p> <hr /> <div ng-controller="isElementcon"> <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('isElementExample', []).controller('isElementcon', function($scope) { var val = document.getElementById('test'); console.log(angular.isElement(val)) $scope.vals = angular.isElement(val); }) </script> </html>