如何在 Eclipse 中运行和调试 AngularJS 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28787462/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to run and debug an AngularJS application in Eclipse?
提问by Harald Wellmann
I'm trying to get started with Nodeclipse. I would like to run and debugan AngularJS application, e.g. the angular-phonecat
example from Eclipse.
我正在尝试开始使用 Nodeclipse。我想运行和调试一个 AngularJS 应用程序,angular-phonecat
例如来自 Eclipse的示例。
In particular, I would like to
特别是,我想
- use a Debug on Serverlauncher to start a server with my application and open a web browser (Firefox or Chromium).
- set a breakpoint in a JavaScript file in Eclipse
- click around in the web browser and have the Eclipse debugger stop at the breakpoint.
- 使用Debug on Server启动器启动带有我的应用程序的服务器并打开 Web 浏览器(Firefox 或 Chromium)。
- 在 Eclipse 中的 JavaScript 文件中设置断点
- 在 Web 浏览器中单击并让 Eclipse 调试器在断点处停止。
(The equivalent of this does work in NetBeans in a very intuitive way.)
(相当于在 NetBeans 中以一种非常直观的方式工作。)
From the Nodeclipse help, I don't see how to get started or whether this is possible at all.
从 Nodeclipse 帮助中,我不知道如何开始或者这是否可行。
I managed to run an debug a Node.js project with the Hello World template, but I don't see how to debug anything running in a web browser.
我设法使用 Hello World 模板运行调试 Node.js 项目,但我不知道如何调试 Web 浏览器中运行的任何内容。
Does that require a Remote Javascript debug launcher? If so, how to use it?
这是否需要远程 Javascript 调试启动器?如果有,如何使用?
Finally, I don't see how to actually runan AngularJS application in Nodeclipse. As far as I can tell, the AngularJS Eclipse plugin only implements editing features but does not deal with running and debugging. Do I need to turn the Angular project into a Node.js application? If so, how?
最后,我没有看到如何在 Nodeclipse 中实际运行AngularJS 应用程序。据我所知,AngularJS Eclipse 插件只实现了编辑功能,不处理运行和调试。我是否需要将 Angular 项目转换为 Node.js 应用程序?如果是这样,如何?
回答by Paul Verest
AngularJS runs in browser, Node.js on server,
so you need different approaches.
AngularJS 在浏览器中运行,Node.js 在服务器上运行,
因此您需要不同的方法。
Nodeclipse is primarily about supporting Node.js and has ChromeDevTools-based debugger. I cannot tell what is best for debugging browser JavaScript, maybe it is Chrome browser.
Nodeclipse 主要是关于支持 Node.js 并具有基于 ChromeDevTools 的调试器。我不知道什么最适合调试浏览器 JavaScript,也许它是 Chrome 浏览器。
managed to run an debug a Node.js project with the Hello World template, but I don't see how to debug anything running in a web browser.
设法使用 Hello World 模板运行调试 Node.js 项目,但我不知道如何调试 Web 浏览器中运行的任何内容。
Ask on https://github.com/angelozerr/angularjs-eclipse/
在https://github.com/angelozerr/angularjs-eclipse/ 上提问
Do I need to turn the Angular project into a Node.js application?
我是否需要将 Angular 项目转换为 Node.js 应用程序?
For Node.js run/debug it is not needed.
对于 Node.js 运行/调试,不需要它。