本文介绍了控制台错误:ng.probe不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我将Angular CLI和核心更新为8.0.0v.之后,我成功地初始化了一个新的应用程序并运行了它.构建应用程序并在 localhost:4200 上提供服务后,我打开了控制台,但出现错误:

Yesterday I updated Angular CLI and core to 8.0.0v. After that I successfully initialized a new app and ran it. Once the app was built and served on localhost:4200 I opened the console and there was an error:

我试图研究此问题,但是没有相关信息.

I tried to research the issue, but there was no relevant info about it.

实际结果:

ng serve/npm启动后,控制台中出现问题:

After ng serve / npm starts there is an issue in the console:

预期结果:

控制台中没有错误

推荐答案

如果有人正在寻找替代方案:

If someone is looking for an alternative to:

ng.probe($0)

在常春藤中,请尝试以下操作:

In Ivy, then please try this:

 ng.getComponent($0);

在这里找到它, https://juristr.com/blog/2019/09/debugging-angular-ivy-console/

我想在这里添加它以完成操作.

Thought I'd add this here for completion.

关于 ng.getComponent 的注意事项:您必须将焦点标签(例如< app-my-component> )放在开发人员工具元素中,以便$ 0.它不会在层次结构中搜索父组件(如 ng.probe 那样).

Note about ng.getComponent: you must focus the component tag ( e.g. <app-my-component> ) in the developer tools elements so that it will be in $0. It doesn't search up the hierarchy for parent components ( like ng.probe does ).

这篇关于控制台错误:ng.probe不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 08:33