如何从浏览器控制台调用 angular 6 函数? [英] How to call an angular 6 function from browser console?

查看:45
本文介绍了如何从浏览器控制台调用 angular 6 函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从浏览器控制台调用一个组件内部的函数.我想要类似这个但相当于角度 6.

I want to call a function that is inside a component from the browser console. I want something like this but equivalent to angular 6.

提前致谢

推荐答案

是的,您可以通过以下方法查看..

Yes you can check by below method..

在您的 google chrome 控制台上,您可以运行以下命令

on your google chrome console, you can run below command

ng.probe($0).componentInstance.<name of function you want to run from component.ts file>

您可以检查输出.

如果您需要进一步说明,请告诉我.

Do let me know if you need further clarification.

请查看参考以获得更好的理解.

Please check reference for better understanding.

这篇关于如何从浏览器控制台调用 angular 6 函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆