aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCaitlin Potter2014-02-04 11:37:09 -0500
committerVojta Jina2014-02-04 16:39:52 -0800
commit36d37c0e3880c774d20c014ade60d2331beefa15 (patch)
treeacf5a90799f618a9be823a6a8dbcf23ba092e095 /src
parent24699ee8f04c1f1459be1d36207e654421d58ff0 (diff)
downloadangular.js-36d37c0e3880c774d20c014ade60d2331beefa15.tar.bz2
fix(jqLite): trim HTML string in jqLite constructor
jQuery will construct DOM nodes containing leading whitespace. Prior to this change, jqLite would throw a nosel minErr due to the first character of the string not being '<'. This change corrects this behaviour by trimming the element string in jqLite constructor before testing for '<'. Closes #6053
Diffstat (limited to 'src')
-rw-r--r--src/jqLite.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index e5980514..f48dd3c0 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -175,6 +175,9 @@ function JQLite(element) {
if (element instanceof JQLite) {
return element;
}
+ if (isString(element)) {
+ element = trim(element);
+ }
if (!(this instanceof JQLite)) {
if (isString(element) && element.charAt(0) != '<') {
throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');