aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorMisko Hevery2010-04-05 11:46:53 -0700
committerMisko Hevery2010-04-05 11:46:53 -0700
commit7a4b48020688060debe9cb0f9c17615d7585cbe7 (patch)
tree48a5b1d8cf92bb272028a106ab9ea3ec16f477a2 /src/Angular.js
parent4bfa4e230d5ebdd582068effe7f4f1b60c43093a (diff)
downloadangular.js-7a4b48020688060debe9cb0f9c17615d7585cbe7.tar.bz2
added ng:switch widget
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Angular.js b/src/Angular.js
index d00a9bf6..0952a352 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -247,7 +247,16 @@ function escapeHtml(html) {
replace(/>/g, '>');
}
+
+function isRenderableElement(element) {
+ var name = element && element[0] && element[0].nodeName;
+ return name && name.charAt(0) != '#' &&
+ !includes(['TR', 'COL', 'COLGROUP', 'TBODY', 'THEAD', 'TFOOT'], name);
+}
function elementError(element, type, error) {
+ while (!isRenderableElement(element)) {
+ element = element.parent() || jqLite(document.body);
+ }
if (error) {
element.addClass(type);
element.attr(NG_ERROR, error);