Menu

Angular Basics and Quickstart with CLI

November 10th, 2017

#Angular Basics and Quickstart with #CLI via @CsharpCorner  #AngularCLI

  • It offers a great way to organize the building blocks of the Angular development environment and also enables you to unit test the application followed by clubbing it with the web pack which bundles all the JavaScript and CSS dynamically and adds them to the main HTML file where our…
  • ng generate is used to create a new class, component, routes services, or Pipes by using this simple command – – – ng serve is used to run start the server and run the application.
  • There are various commands like ng e2e, ng lint, ng test, ng build, ng doc etc. but the above 3 commands are needed to start an application.
  • The syntax for creating a new application in the given directory would be – – – There are various ways to create the application from the command prompt or from the integrated terminal we have within the Visual Studio Code.
  • In this ng New command, MyFirstApp8Nov is the project name that I have given to create the new application.

Imagine what it would be to manually add the configuration files required to bootstrap an Angular 4 application. It is painful, right? For beginners, it might become tedious to declare all these files and manually configure all these files to bootstrap the app. It wouldn’t be a good idea to set up the configuration things rather than focus on the framework and its usage. Even for the advanced developer, it might not be a great way to do all these things manually. So, Angular CLI is the solution here

Why Angular CLI

Imagine what it would be to manually add the configuration files required to bootstrap an Angular 4 application. It is painful, right? For beginners, it might become tedious to declare all these files and manually configure all these files to bootstrap the app. It wouldn’t be a good idea to set up the configuration things rather than focus on the framework and its usage. Even for the advanced developer, it might not be a great way to do all these things manually.

So, Angular CLI is the solution here.

What it offers

It offers a great way to organize the building blocks of the Angular development environment and also enables you to unit test the application followed by clubbing it with the web pack which bundles all the JavaScript and CSS dynamically and adds them to the main HTML file where our application gets loaded.

CLI stands for the Command Line Interface.

Let’s see how we can install the Angular CLI on a machine and quick start our project.

Prerequisites for Angular CLI

Install Node.js and NPM

The first step to use Angular CLI is to install the Node.js and npm. Node.js uses Chrome V8 Engine to run the JavaScript on Servers and it also acts as the repository for various opensource packages which can be installed by using npm (NuGet Packet Manager).

To get the…

Angular Basics and Quickstart with CLI