G B
G B

Reputation: 2453

Angular CLI Creating files in the same folder error

Am having this issue, where when I generate components with Angular CLI instead of generating them in the same folder I have CD in it generate them in the App folder. Lets say I have CD to App/Recipe and I use this "ng g c recipe-item" it will be generated in App folder instead of Recipe. enter image description here

Upvotes: 2

Views: 2457

Answers (2)

Mosby42
Mosby42

Reputation: 130

if you want to generate a new component called recipe-item inside of the recipe directory:

ng g c recipe/recipe-item

See page 2: https://cli.angular.io/reference.pdf -> ng generate -> Valid types: -> component

Upvotes: 8

candidJ
candidJ

Reputation: 4359

as shown on angular-cli page

components support relative path generation

try using

ng g component recipe-item

Upvotes: 0

Related Questions