简体   繁体   English

TypeError:无法读取未定义的属性“ nodeName”

[英]TypeError: Cannot read property 'nodeName' of undefined

I'm having this message in an angular app after submitting the form: 提交表单后,我在Angular应用中收到此消息:

TypeError: Cannot read property 'nodeName' of undefined (chrome dev console tells me the error is in "elem.parent()[0].nodeName" (line 2) TypeError:无法读取未定义的属性“ nodeName”(Chrome开发者控制台告诉我该错误位于“ elem.parent()[0] .nodeName”中(第2行)

while (!angular.equals(elem.parent(), $document) && !angular.equals(elem[0], $document[0].documentElement)) {
    if (['form', 'ngForm','userForm'].indexOf(attrs.$normalize(angular.lowercase(elem.parent()[0].nodeName))) > -1) {
        isValid = true;
        break;
    }
    formElem = elem.parent();
}

Could someone help me on this? 有人可以帮我吗?

Try debugging the process to understand what iterElem.parent()[0] contains. 尝试调试过程以了解iterElem.parent()[0]包含的内容。 If you want to verify that the property is not undefined, try using: angular.isUndefined(iterElem.parent()[0].nodeName) . 如果要验证属性是否未定义,请尝试使用: angular.isUndefined(iterElem.parent()[0].nodeName)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 bs-tooltip TypeError:无法读取未定义的属性“nodeName” - bs-tooltip TypeError: Cannot read property 'nodeName' of undefined 未捕获的类型错误:无法读取 null 的属性“nodeName” - Uncaught TypeError: Cannot read property 'nodeName' of null 无法读取SVG文件中未定义的属性“ nodeName” - Cannot read property 'nodeName' of undefined in SVG file Trumboqyg 所见即所得编辑器不适用于 Jquery.Validate 插件,“Uncaught TypeError: Cannot read property 'nodeName' of undefined” - Trumboqyg WYSIWYG editor does not work with Jquery.Validate plugin, "Uncaught TypeError: Cannot read property 'nodeName' of undefined" VideoJS 错误 Uncaught TypeError: Cannot read property 'nodeName' of null - VideoJS error Uncaught TypeError: Cannot read property 'nodeName' of null 无法使用select2读取jQuery验证上未定义的nodeName属性 - Cannot read property of nodeName undefined on jQuery validation with select2 错误:“无法读取未定义的属性 'nodename'” 转换 html 表时 - Error : “cannot read property 'nodename' of undefined” While converting html Table 无法读取未定义的属性“ on”(TypeError) - Cannot read property 'on' of undefined (TypeError) TypeError:无法读取未定义#2的属性'then' - TypeError: Cannot read property 'then' of undefined #2 TypeError:无法读取未定义的属性“0” - TypeError: Cannot read property '0' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM