The Angular CLI is the primary command line interface used for working with Angular code. It provides tools to perform various essential tasks related to Angular development, including:
These are the ones you’ll use day-to-day while coding:
ng new my-app Think of it like laying the foundation for a house. → Creates a brand-new Angular project with all the necessary setup.
ng serve Every time you save, it refreshes the browser automatically. → Runs the app locally in development mode with live reloading.
ng generate component my-component Saves you from writing repetitive setup code. (shortcut: ng g c my-component) → Creates a new component with boilerplate code (HTML, CSS, TS, test file).
ng generate service my-service → Creates a new service class (often used for logic or API calls).
ng generate module my-module → Creates a module, useful for organizing features.