How to run and debug an AngularJS application in Eclipse?

Harald Wellmann picture Harald Wellmann · Feb 28, 2015 · Viewed 10.6k times · Source

I'm trying to get started with Nodeclipse. I would like to run and debug an AngularJS application, e.g. the angular-phonecat example from Eclipse.

In particular, I would like to

  • use a Debug on Server launcher 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.

(The equivalent of this does work in NetBeans in a very intuitive way.)

From the Nodeclipse help, I don't see how to get started or whether this is possible at all.

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.

Does that require a Remote Javascript debug launcher? If so, how to use it?

Finally, I don't see how to actually run an 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?

Answer

Paul Verest picture Paul Verest · Mar 2, 2015

AngularJS runs in browser, Node.js on server,
so you need different approaches.

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.

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.

Ask on https://github.com/angelozerr/angularjs-eclipse/

Do I need to turn the Angular project into a Node.js application?

For Node.js run/debug it is not needed.