简体   繁体   English

如何在 Angular JS 中隐藏控制台错误消息?

[英]How to hide console error messages in Angular JS?

How to hide console error messages in Angular JS?如何在 Angular JS 中隐藏控制台错误消息? My web apps is works, no bug!!!!我的网络应用程序运行正常,没有错误!!!! but it has a lot of error message in console.但它在控制台中有很多错误消息。

thanks谢谢

Update: I just fix my bug, but this bug can't fix.............anyidea...THX更新:我只是修复了我的错误,但这个错误无法修复.........anyidea...THX 在此处输入图片说明

It looks like most of the errors you show in your screenshot stem from the same issue - namely, attempting to call .length on an object that does not exist.看起来您在屏幕截图中显示的大多数错误都源于同一问题 - 即尝试在不存在的对象上调用.length

If you expect the object to not exist sometimes, then you should fix the source of that error with something like:如果您希望对象有时不存在,那么您应该使用以下内容修复该错误的来源:

if (object.length) { ... do something with .length property ... }

Errors should not be ignored!错误不容忽视! They're our only window into understanding when our programs are not behaving as we intend.它们是我们了解程序何时不按预期运行的唯一窗口。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM