mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-10 22:44:01 +08:00
fix($compile): fix regression which affected old jQuery releases
ddb8081and4ea57e7removed the calls which trimmed leading and trailing whitespace from templates in the HTML compiler. This broke old versions of jQuery (such as 1.9.1), which do not trim whitespace in their constructors. Naturally, this would not appear in the jQuery tests, as we are testing against a version which does trim whitespace in the constructor. This fix re-adds calls to `trim()` when compiling templates in $compile, in order to avoid breaking old versions of jQuery.
This commit is contained in:
@@ -1258,7 +1258,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
if (jqLiteIsTextNode(directiveValue)) {
|
||||
$template = [];
|
||||
} else {
|
||||
$template = jqLite(directiveValue);
|
||||
$template = jqLite(trim(directiveValue));
|
||||
}
|
||||
compileNode = $template[0];
|
||||
|
||||
@@ -1685,7 +1685,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
||||
if (jqLiteIsTextNode(content)) {
|
||||
$template = [];
|
||||
} else {
|
||||
$template = jqLite(content);
|
||||
$template = jqLite(trim(content));
|
||||
}
|
||||
compileNode = $template[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user