├── src
│ ├── app
│ │ ├── core
│ │ │ ├── services
│ │ │ ├── core.module.ts
│ │ ├── shared
│ │ │ ├── produt-form
│ │ │ │ ├── product-form.component.ts|html|css
│ │ │ │ ├── product-form.service.ts
│ │ │ │
I have 2 modules core and shared. I have product-form component in shared module. and also that product-form has product-form.service. I use that service to format the form data and return it again to the product-form.component. that service only use by product-form.
so I need to know, can I placed the product-form.service in product-form component like above structure? or should I placed it in core module services folder?
I am a beginner for angular.
thank you.
Yes, you can. There are few approached in design:
But if you will ask me how I would do, I will create a library and place there all my shared servies and components. In this case they will bake separately in library and the main application will call only what it's needed.
If you want to read more about libraries: https://angular.io/guide/creating-libraries