mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
fix infinite loop in elementError when working with detached elements
This commit is contained in:
parent
78a0f41058
commit
cf1d365f57
1 changed files with 10 additions and 1 deletions
|
|
@ -702,10 +702,19 @@ function isRenderableElement(element) {
|
|||
return name && name.charAt(0) != '#' &&
|
||||
!includes(['TR', 'COL', 'COLGROUP', 'TBODY', 'THEAD', 'TFOOT'], name);
|
||||
}
|
||||
|
||||
function elementError(element, type, error) {
|
||||
var parent;
|
||||
|
||||
while (!isRenderableElement(element)) {
|
||||
element = element.parent() || jqLite(document.body);
|
||||
parent = element.parent();
|
||||
if (parent.length) {
|
||||
element = element.parent();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (element[0]['$NG_ERROR'] !== error) {
|
||||
element[0]['$NG_ERROR'] = error;
|
||||
if (error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue