This project was generated with Angular CLI version 16.1.6.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
The most commonly used commands in Angular Angular commands you have to know
Hi there,
As you dive deeper into Angular, you will find yourself frequently using several Angular CLI commands.
To make your life a bit easier, I've put together a quick cheat sheet of the most commonly used commands in Angular, along with a brief description of each. You can also find this sheet in a PDF format attached to this lecture.
Save this sheet for later and refer to it whenever you need a quick refresher:
ng new projectName
Creates a new Angular project with the specified project name.
ng serve
Builds the application and starts a web server to serve your application during development.
ng serve --open
or
ng serve -o
Same as ng serve, but also opens your default web browser to the application.
ng generate component componentName
or
ng g c componentName
Generates a new component with the specified name.
ng generate service serviceName
or
ng g s serviceName
Generates a new service with the specified name.
ng build
Builds your application for production, creating a dist/ folder with the output.
ng update
Checks your application for outdated dependencies, and can also update them.
Remember, these commands should be run in a terminal or command prompt from within your Angular project's root directory.
I hope you find this cheat sheet helpful as you navigate your Angular journey.
Happy coding!
Mukund