Contenido del Curso
Introduction to Angular
Introduction to Angular
Getting Started with Angular CLI
Now that we’ve installed all the necessary tools, including Node.js, VS Code, and Angular CLI, it’s time to create our first project and explore how Angular CLI simplifies development.
What is Angular CLI?
It allows you to:
-
Quickly create new projects with a predefined structure;
-
Generate components, services, and other project elements;
-
Start a development server for testing and debugging;
-
Build the application for production deployment.
With Angular CLI, you don’t need to manually configure files and dependencies—everything is set up automatically.
Setting Up Your Workspace
Before creating a new project, choose a convenient location on your computer where you want to store your Angular projects.
If you don’t have a dedicated folder for projects, create one using the following command:
This command creates a new folder named projects
in the specified location.
Next, navigate to the newly created folder by running:
This command opens the projects
folder, allowing you to work inside it.
Creating an Angular Project with CLI
To create a new Angular project, run the following command inside your project folder:
-
ng new
- the command for creating a new Angular project; -
angular-app
- the project name (you can use any name you prefer).
After running the command, Angular CLI will prompt you with a few setup questions:
-
Would you like to add Angular routing? - you’ll cover this later, so for now, select
Yes
; -
Which stylesheet format would you like to use? - this determines the type of stylesheets for your project. I recommend choosing CSS, but you can select the option that suits you best.
Once you confirm these options, Angular CLI will begin installing dependencies. This process may take a few minutes as it downloads and installs all the necessary packages.
When the setup is complete, a success message will appear, indicating that the project has been created successfully.
Now, you can open the project in VS Code, which we installed earlier.
After the project is created, Angular CLI automatically generates the necessary folder and file structure. You’ll take a closer look at this in the next chapter!
¡Gracias por tus comentarios!