codeDragon
codeDragon

Reputation: 565

Generate a new class into a specific folder in Angular

When I am trying to use ng g class classname and I am in the folder I want my class to be created, it still creates it outside the folder, in the app folder for instance.

What I read is that the previous way is the way to do, so do you know why it doesn´t work?

Upvotes: 0

Views: 1324

Answers (1)

Boanta Ionut
Boanta Ionut

Reputation: 402

For example you have app/components/folder/ The command is :

ng g class components/folder/yourClassName 

add --flat at the end if you don't want a folder created. You don't have to be in that folder, you can be in root folder of the app

Upvotes: 2

Related Questions