Angular Commands

The following are the list of Angular Commands.

New Angular Project:
  • ng new ProjectName e.g. ng new hello-World (Default)
  • ng new hello-world --skipGit (Without Git Folder)
  • ng new hello-world --skipTests --minimal (With test folder 

Compile and Run Angular Application:

  • ng serve (Only run of Angular Application)
  • ng serve -o (To Build and run Angular Application)
Create Component in Angular:

  • To Create Component with Default Options
    • ng generate component ComponentName or ng g c ComponentName
      • e.g. ng generate component test1 (Default)
      • e.g. ng g c test1 (short version)
  • To Create Component without "HTML" & "CSS" Files
    • ng generate component ComponentName -it -is or ng g c ComponentName -it -is
      • e.g ng g c test2 -it -is
  • To Create Component without "Test File", "HTML" & "CSS" Files:
    • ng generate component ComponentName -it -is --skipTests or ng g c ComponentName -it -is --skipTests 
      • ng g c test3 -it -is --skipTests
  • To Create Component without "Folder", "Test File", "HTML" & "CSS" Files:
    • ng generate component ComponentName -it -is --skipTests --flat or ng g c ComponentName -it -is --skipTests --flat
      • ng g c test4 -it -is --skipTests --flat

Other Commands:
  • Version: ng --version

Comments

Post a Comment