From a87f2fb9e4d65ac5d260e914b5e31aa0e0f47b2c Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 4 Nov 2011 12:33:01 -0700 Subject: refactor(mock): moved mocks into its own module --- src/Angular.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/Angular.js') diff --git a/src/Angular.js b/src/Angular.js index fcb13881..af441e1c 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -426,6 +426,17 @@ function trim(value) { return isString(value) ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value; } +/** + * @ngdoc function + * @name angular.isElement + * @function + * + * @description + * Determines if a reference is a DOM element (or wrapped jQuery element). + * + * @param {*} value Reference to check. + * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element). + */ function isElement(node) { return node && (node.nodeName // we are a direct element @@ -1012,7 +1023,7 @@ function assertArg(arg, name, reason) { function assertArgFn(arg, name) { assertArg(isFunction(arg), name, 'not a function, got ' + - (typeof arg == 'object' ? arg.constructor.name : typeof arg)); + (typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg)); return arg; } @@ -1034,6 +1045,7 @@ function publishExternalAPI(angular){ 'isFunction': isFunction, 'isObject': isObject, 'isNumber': isNumber, + 'isElement': isElement, 'isArray': isArray, 'version': version, 'isDate': isDate, -- cgit v1.2.3