Can we debug Widgets?

As part of Learning, Can we see (code) that what the widgets are actually doing in back-end like how they are connecting to database, opening new pages, etc..
1 answers

If you want to read the code, you can always unzip a widget and read the source code. 

You can find the widget in your project directory, right click, extract / unzip to a location and voila you can read the code. 

If you want to debug a widget running in an app, it's easier when you have the app running locally. You can run the chrome inspector and find the widget code in sources tab under your app domain > widgets. You can add breakpoints there and inspect the working. For native apps, see if this helps :