4

I am learning Angular routing going through Angular doc but not able to understand the --flat in ng command

ng generate module heroes/heroes --module app --flat --routing 
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Rohit Shukla
  • 49
  • 1
  • 4

2 Answers2

6
ng generate module app-routing --flat --module=app

--flat puts the file in src/app instead of its own folder.

--module=app tells the CLI to register it in the imports array of the AppModule.

Read more here https://angular.io/tutorial/toh-pt5

Thanveer Shah
  • 3,250
  • 2
  • 15
  • 31
4

This is what the Angular Docs have to say:

When true, creates the new files at the top level of the current project root.

Default: false

Since you've written heroes/heroes, the files will be created in a folder named heroes

Read more about it here

Community
  • 1
  • 1
SiddAjmera
  • 38,129
  • 5
  • 72
  • 110