View video tutorial

ANGULAR First Project

ANGULAR

Angular uses commands to create project and its components.

Using Angular CLI to create angular project


➔ Angular projects can be created using the Angular CLI, which is a command line interface used to build and run applications.

➔ After creating the project using the command line tool, any IDE is required to edit the project code.

➔ VS Code is the most popular choice for Angular developers.

Create new project


Nodejs download

Open command prompt.

Nodejs download

Type the command ng new my-first-project at the command line prompt and press Enter to execute the command. The project will be created under the location (shown in the command prompt) here with the project name as the my-first-project directory.

Nodejs download

Type y for yes and press enter.

Nodejs download

CSS is selected by default, press enter.

Nodejs download

The project is created under the location shown in the command prompt (the path you are already in).

Nodejs download

Open the Visual Studio Code IDE and then select File->Open Folder. Select the project name folder where it is located and click open to open the project in the VS Code editor.

Nodejs download

The project is now opened in the VS Code editor and any Angular code can be edited.

Nodejs download

To run the project, go to command prompt.cd my-first-project (to go to inside the project folder issue this command).ng serve (to run the project issue this command).

Nodejs download

Copy the highlighted link http://localhost:4200/ and paste it on the browser address bar.

Nodejs download

The output shows the view of the default application when it is run