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
-
Open Visual Studio Code and click on the "View" drop down, then click on "Extensions".
-
Search for the desired extension or theme by typing its name in the search box.
-
Click the Install button next to the extension or theme you want to add.
-
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.