0

When I generate a component with the angular 2 cli:

ng g component "test" it creates a folder:

test
 |__Shared
 |   |__Index.ts
 |__test.component.html
 |__test.component.css
 |__etc...

What is the Shared folder? I mean what am I assumed to share between a html and css file? Or between a test.component.ts and a test.component.css ?

That makes no sense to me to create for each component a shared folder.

Can anyone explain that to me please?!

1 Answer 1

2

The shared folder is created to stay in line with the style guide set forth from angular. In this case it seems that the CLI is anticipating that you might create components within components and so it creates the shared folder when a component is created.

Here is some more reading about someone who questioned why there was a shared folder.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.