aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorMisko Hevery2011-02-12 10:12:10 -0800
committerMisko Hevery2011-02-16 00:49:16 -0500
commit496e6bf9016d33a7cf2f4730d06a8655f01ca5cb (patch)
tree068f86776aa08a8dce1dde05ef1e079f739073fc /src/Angular.js
parent23b255a8b7481ff5c06004b3558c07f981c42276 (diff)
downloadangular.js-496e6bf9016d33a7cf2f4730d06a8655f01ca5cb.tar.bz2
refactored quickClone to cloneNode and exposed it on jQuery
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 5bd5e547..9b2c7ea6 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -453,10 +453,6 @@ if (msie) {
};
}
-function quickClone(element) {
- return jqLite(element[0].cloneNode(true));
-}
-
function isVisible(element) {
var rect = element[0].getBoundingClientRect(),
width = (rect.width || (rect.right||0 - rect.left||0)),
@@ -1034,9 +1030,23 @@ function bindJQuery(){
// reset to jQuery or default to us.
if (window.jQuery) {
jqLite = window.jQuery;
- jqLite.fn.scope = JQLite.prototype.scope;
+ extend(jqLite.fn, {
+ scope: JQLite.prototype.scope,
+ cloneNode: cloneNode
+ });
} else {
jqLite = jqLiteWrap;
}
angular.element = jqLite;
}
+
+/**
+ * throw error of the argument is falsy.
+ */
+function assertArg(arg, name) {
+ if (!arg) {
+ var error = new Error("Argument '" + name + "' is required");
+ if (window.console) window.console.log(error.stack);
+ throw error;
+ }
+};