I just recently build a web based app with angular. I really love how angular handle Model-View-Controller, so I build my controller to handle button click event, datepicker changed event, etc while business logic is being controlled by the model. The problem is: the more button or control I put into my view, the larger my controller script is .
For example: If I have 2 buttons, my controller would be look like this:
$scope.onBtn1Clicked = function(){}
$scope.onBtn2Clicked = function(){}
So, what if I have 10 more buttons ? 10 more function ? I'm well aware about Angular's directive, but I don't want to write an directive if I will use it just once. So I think it is better to split/divide my controller into several "sub controller" files and joined them in my "main controller".
Can it be done ? Or anyone have other solution ? Thx
PS: I know about How to create separate AngularJS controller files? . But this is different: I already have separated my controllers to several files, so that a page in my application have one controller. The problem I have is that those controller become so large and impossible to maintain