2

I have tried all the command to generate a component in other than app folder . But angular always creates component inside app .

I want to generate component inside lib folder

Here is the structure : enter image description here

Here are the commands tried : enter image description here

still now working

Using an extension as in answers worked (check chat)

enter image description here

Divyanshu Jimmy
  • 2,542
  • 5
  • 32
  • 48

1 Answers1

2

Once you set the directory in which the component needs to be created(src/lib) in terminal, you should provide the component name as follows with out any path

ng generate component test

this might be throw an error saying

Could not find an NgModule. Use the skip-import option to skip importing in NgModule.

then try as follows

ng generate component test --skip-import

If in case the above solution are not working, Please install following extention for vs code ide Angular Files. which will allow you to create the components from a context menu.

Anto Antony
  • 842
  • 6
  • 12