问题描述
昨天我将 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:
ng.probe 不是函数
我试图研究这个问题,但没有相关信息.
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:
未捕获的类型错误:ng.probe 不是函数.当前控制台状态当前角度状态
预期结果:
控制台没有错误
推荐答案
如果有人正在寻找替代方案:
If someone is looking for an alternative to:
ng.probe($0)
在 Ivy 中,请尝试此操作:
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
的注意事项:您必须将组件标签(例如 )聚焦在开发人员工具元素中,以便它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 不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!