0
Debugging Angular or JS file
Does anyone know or has an idea on debugging angular or javascripts. Thank you!
4 Réponses
+ 9
You can use any browser!
+ 1
You can debug the js or angular file using the 'debugger;'
Just write this debugger text in the js file anywhere like:-
Example:-
function add(){
debugger;
}
And now run the program and in the browser -> right-click -> inspect
And when this function is called then the debugger will activate.
You can also use the console. log();
Example:-
function add(){
int a = 5;
int b = 5;
int c = a+b;
console.log(c);
}
browser -> right-click -> inspect -> console
And you can see the result.
Hope you get it.
0
you can debug js through browser
0
Thank you Shaili this is very helpful. I was thinking to debug it via vs code, but I think this will do.