The Project is going too big now. I have created several components some of them are full of code some of them are having less code. I would like to know when do we create a new component and for a component when do we need to move on and create a additional sub component for the additional functionality. Thanks
is opinion based answer. So what will follow is my vision of your question and not universal answer.
But when we talk about angular and architecture pattern provided by Angular, We can distinct 3 mains cases :
(To keep it simple i will not add to my explication Pipe and Directive)
Let start by the most easier case, UI Component, is normal component who don't do any traitment, just take Input for configuration and Output some Event. Goal is to have peace of application easy to change / reuse. This part should be strongly uncoupled from your business logic.
Because you have uncoupled your UI, you need Middleware component or container component (pick up your prefered name :D), who will do the bridge between your UI component and your business Logic.
And all business logics (and not only your ajax call) have to be embed on your service. Why ? because :
If you keep in mind all this "Main category", you can respect SOLID principle.
If you want to dig more : you have awesome conference from Todd Motto