Diego De La Puente

VS Code Overview

Visual Studio Code (VS Code) is a highly versatile IDE that enhances Angular development by offering a rich ecosystem of extensions, robust debugging tools, and seamless integration with Angular frameworks. Its lightweight design ensures fast performance, while built-in support for TypeScript and JavaScript accelerates coding efficiency. Features like IntelliSense provide intelligent code completion, making development faster and reducing errors. The integrated terminal, version control, and live server capabilities streamline workflows, from writing and testing code to deploying applications. Unlike many other IDEs, VS Code's active open-source community frequently updates plugins and tools, keeping developers at the cutting edge of Angular development. This makes it an ideal choice for developers seeking a responsive, customizable, and feature-rich environment for Angular projects. Please navigate to the Visual Studio Code page to download your respective Operating System version.

Install VS Code on Windows

1. Install Procedures

To install Visual Studio Code, follow these steps:

  1. Visit the Visual Studio Code website.
  2. Download the Windows x64 "Stable" installer - pick the latest "Stable" release. This means the release has been tested and is stable for the community.
  3. Go through the installation wizard and install Visual Studio Code at your desired location, mine was similar to the following location: C:\Users\FirstName_LastName\AppData\Local\Programs\Microsoft VS Code.
  4. During installation, choose the following options in the install wizard dialog boxes:
    • I did NOT select "Open with" options.
    • Select "Add to PATH" option and allow the install wizard to add VS Code to your Windows `%PATH%`.

2. Configure Extensions and Themes

After installing Visual Studio Code, I configured several extensions and themes to enhance my development environment. These tools are crucial for improving productivity and aligning with my learning experiences in various courses.

Extensions and Themes Added

  • Angular Language Service by John Papa: This extension provides advanced editing and productivity support for Angular applications. It was used in both my Udemy course and Skill Distillery boot camp.
  • Angular Essentials by John Papa: A comprehensive toolkit for Angular development, including snippets, commands, and more. It was used primarily during my Udemy course.
  • Material Icon Theme by Philipp Kief: Adds a visual theme with Material Design icons to the VS Code interface. This theme was used during my Skill Distillery boot camp to improve the visual organization of files.
  • Angular 8 and TypeScript/HTML VS Code Snippets by Dan Wahlin: Provides a collection of snippets for Angular, TypeScript, and HTML. This extension was beneficial during my Skill Distillery boot camp to streamline coding with commonly used code patterns.

How to Add Extensions and Themes

  1. Open Visual Studio Code and click on the "View" drop down, then click on "Extensions".
  2. Search for the desired extension or theme by typing its name in the search box.
  3. Click the Install button next to the extension or theme you want to add.
  4. Once installed, follow any additional configuration instructions provided by the extension or theme.

3. Starting Up the Development Server

To start the development server for your Angular project using npm, open the integrated terminal in VS Code and run:

npm start

or run ng serve in the integrated terminal in VS Code:

ng serve

After running the command, navigate to http://localhost:4200/ in your web browser.

Stopping the Server:

To stop the local server hosted by Node.js in the VS Code terminal, press Ctrl + C. When prompted, type y to confirm and press Enter.

Differences Between ng serve and npm start:

  • npm start is a flexible command that can perform various tasks defined in your project’s package.json file. Besides starting a server, it can:
    • Run build scripts: It can compile your code, bundle files, and prepare everything for deployment.
    • Run test scripts: It can execute tests to make sure your code works as expected.
    • Start a development environment: It can set up necessary tools and configurations for development, like starting a server with hot-reloading.
    • Launch applications: It can start applications or services needed by your project, like a database or a separate backend server.
    • Perform pre-start tasks: It can execute tasks that need to be done before starting the server, such as cleaning up temporary files or generating necessary assets.
  • ng serve is specifically made for Angular projects. It builds your Angular app, bundles the files, and starts a server to show your app in a browser. It’s focused on Angular-specific needs, making it easier to manage and understand for Angular projects.

While both npm start and ng serve can both start your Angular app (accessible through a local server), ng serve is tailored for Angular projects, ensuring all necessary Angular-specific tasks are handled. This makes ng serve more straightforward and effective for Angular development.

4. Media

Install VS Code on macOS

1. Overview

This section covers how to install Node.js and npm on a macOS system. Node.js can be installed via a package manager or directly from the Node.js website.

2. Installation Steps


public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, Java!");
        int a = 10;
        int b = 20;
        int sum = a + b;
        System.out.println("Sum of " + a + " and " + b + " is: " + sum);
    }
}

3. Media

macOS Installation Screenshot