Getting Started
- ✔️Generate an Angular applicationLearn how to use Angular CLI to generate an Angular application.
- ✔️Run the applicationServe the application locally and see the default boilerplate page.
- ✔️Understand hot reloadUnderstand how hot reload works in Angular applications.
Project creation
Angular provides a command-line interface (CLI) to generate a new Angular application, manage the project, and run the application locally.
🎓 Instructions
-
Open a terminal and run the following command to create an Angular application:
Open the project
🎓Instructions
- open Visual Studio Code.
- Click on the
File
menu and selectOpen Folder
. - Navigate to the
practical-course
folder and click on theSelect Folder
button.
Running the application
Angular CLI provides a command to serve the application locally.
🎓 Instructions
// TODO use hmr to avoid list being reset on hot reloading
-
Open a terminal in Visual Studio Code.
-
Type the following command to start the application:
-
Open your browser and navigate to
http://localhost:4200
. -
You should see the following default boilerplate page:
Hot reload
Hot reload is a feature that allows you to see the changes you make in your code without having to manually refresh the page.
🎓 Instructions
-
Open the
src/app/app.component.html
file. -
Replace the full content of the file with the following code:
-
Go back to your browser to see the following page: