AngularJS Built-in helper Functions angular.isElement

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

The angular.isElement returns true if the argument passed to it is a DOM Element or a jQuery wrapped Element.

angular.isElement(elem)

This function is useful to type check if a passed argument is an element before being processed as such.

Examples:

angular.isElement(document.querySelector("body"))
// true
angular.isElement(document.querySelector("#some_id"))
// false if "some_id" is not using as an id inside the selected DOM
angular.isElement("<div></div>")
// false


Got any AngularJS Question?