Giter VIP home page Giter VIP logo

Comments (4)

bojidaryovchev avatar bojidaryovchev commented on August 26, 2024

Basically what I do when I want to see whats happening is I put a console.log wherever I need it.. If you want to debug the angular app, you need to have the angular dev server running, preferably concurrently with the backend server - for that purpose, run "npm run watch" - then, you put a console.log in the angular component or in some controller/resolver handler.. Heres an example:

https://ibb.co/bx7LHd
https://ibb.co/fBzpAy
https://ibb.co/d1M2Vy

from nest-angular.

jesusvalenzuelar avatar jesusvalenzuelar commented on August 26, 2024

Hi,

Consider adding a launch setting for vscode, for example:

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Iniciar programa",
            "program": "${workspaceFolder}\\index.js",
            "outFiles": [
                "${workspaceFolder}/dist/**/*.js"
            ]
        }
    ]
}

and in your index.js just run your app:

require('ts-node/register');
require('./src/server');

At the end just press F5 Key in visual studio code and add some breakpoint to start debugging.

from nest-angular.

windivi avatar windivi commented on August 26, 2024

you can try this:
"node --inspect -r ts-node/register src/server/main.ts";
.vscode:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"restart": true,
"port": 9229
}
}

from nest-angular.

weeco avatar weeco commented on August 26, 2024

You can also run ts-node directly with VSCode and therefore no transpilation is needed at all:

      {
          "type": "node",
          "request": "launch",
          "name": "Request Worker",
          "runtimeArgs": [
              "--nolazy",
              "-r",
              "${workspaceRoot}\\node_modules\\ts-node\\register"
          ],
          "args": [
              "${workspaceRoot}\\src\\request-worker\\main.ts"
          ]
      }

As of debugging Angular apps I'd use the chrome debugger, as described here: https://code.visualstudio.com/docs/nodejs/angular-tutorial . This way you can debug your angular frontend code in VSCode

from nest-angular.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.