Pindakaas Pindakaas - 1 year ago 130
AngularJS Question

how to debug the js in jsfiddle

I am looking at this jsfiddle:
It works fine that is not the problem , I just want to know how to debug through the javascript. I tried to use the debugger command and I cant find it in the sources tab?
any idea how I can debug this?

some code from the fiddle:

angular.module('app', ['appServices'])
.config(['$routeProvider', function($routeProvider) {
when('/home', {templateUrl: 'home.html', controller: HomeCtrl}).
when('/list', {templateUrl: 'list.html', controller: ListCtrl}).
when('/detail/:itemId', {templateUrl: 'detail.html', controller: DetailCtrl}).
when('/settings', {templateUrl: 'settings.html', controller: SettingsCtrl}).
otherwise({redirectTo: '/home'});

Answer Source

Literally add the word debugger; to your javascript and Chrome will break at that point



Note you must have the debugging console (F12) open before it hits the debugger; call or it won't work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download