How to create a new Angular project

featured_image

With Angular CLI you can bootstrap a new project effortlessly. Let’s create a new Angular 6 application complemented with Bootstrap 4 and Sass preprocessor.

Requirements

  • Angular CLI – a command line interface tool that generates projects, components, modules, services.
    I’m working on:
  • npm, remember that Node.js has to be installed. Check out the post about managing project dependencies with npm if your project lacks a javascript package manager.
  • In this post the example project depends on the scss preprocessor. If you want to set a different preprocessor or alter the global configuration for all feature projects – read the How to change a CSS preprocessor in an Angular project post.

Create a fresh project

Run the following command to generate a fresh project:

Go to the project main directory:

A git repository has been already initialized:

npm allows you to fix some known vulnerabilities found in the project dependencies, you can run the following command:

This command automatically eliminates well-acknowledged javascript vulnerabilities by updating those faulty libraries versions that don’t introduce braking changes.

Remember to commit the adjustments made in the package.json file:

Install Bootstrap

To add the latest version of the Bootstrap styles to the project, run the following command:

Add the following path in the angular.json file:

Start the Angular server to make sure that the project was successfully created:

Photo by Autri Taheri on StockSnap

Leave a Reply

Your email address will not be published. Required fields are marked *