Angular Application with Angular CLI

 Once we Installed Angular CLI we can check CLI version using "ng version" command in command prompt of windows or terminal in mac.

Now try with "ng help" you will get a list of ng commands with its description as shown below, we have already used "ng version" from the list.



Creating Application with CLI:

For creating a new angular project we can use "ng new projectName" command.
Open Command prompt and change the directory to the folder in which you want to create the project. See Screenshot below:


when you type command "ng new todoList" it will question like routing is required so based on your required if there is multiple page and you need to route from one page to another then mark it as Yes.

Once above installation is success then you can check whether your project is created or not by using command dir in windows and ls in mac. Refer below screen shot:


You can see a list of files are created in your project folder.

Now you have created your project and we are going to build and run our project for this we can use command "ng serve". In your command prompt put this "ng serve" command and press Enter it will start building your application as shown below:



Here you can see our project is build successfully and it is listened to "http://localhost:4200/" , in your chrome browser open this localhost URL , similar to below screenshot will appear:




Previous Topic(Install Angular CLI)                                                  Next Topic (Import Project in IDE)

Comments

Popular posts from this blog

Installing Node Js (NPM) & Visual Studio Code

Logout Component and Angular Router (CanActivate)

Authentication and Session Storage