Link to home
Start Free TrialLog in
Avatar of mikha
mikhaFlag for United States of America

asked on

how to debug angular code ?

I am learning angularjs , and have mostly worked in .net space.

what are few ways/tools/tips/tricks to debug angular code?
Avatar of leakim971
leakim971
Flag of Guadeloupe image

first, be sure to use the not minified versions of plugins, the minified don't display error in console
this amazing extension was not up2date, give a try : https://chrome.google.com/webstore/detail/angularjs-batarang/ighdmehidhipcmcojjgiloacoafjmpfk
you're supposed to create testing units : https://docs.angularjs.org/guide/unit-testing
but as I'm a bad programmer I never used it
In principle you you google chrome dev tools (Press F12) to debug using:
- Elements: To inspect HTML
- Console tab: IT will display any errors/warnings and log messages.
- Sources: Set breakpoints and debug

But as a tool your are better off using Visual Studio Code. (It is free download and add an Angular extension to customise the IDE to Angular)
It is simpler than VS2017 but it is the tool of choice for front end development..
Avatar of mikha

ASKER

@leakim971 & @Miguel - thanks both for your comments.

@Miguel - I have used visual studio so far. with visual studio code, is it possible to set up the break points or do attach to process , similar to visual studio. how do you start debugging with visual studio code?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial