mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 11:37:38 +08:00
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
This commit is contained in:
committed by
Vojta Jina
parent
24699ee8f0
commit
36d37c0e38
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user