I have a huge controller, I divided it into subcontrollers, which I put in other files in accordance with their functionality.
Everything works fine, but I need advice and an answer to my question: Did I do it right?
here is a huge controller:
function controller($scope, $http) {
here is the code of my subcontroller in another file that I load after the front controller:
function someFunction($scope, boolA, function1, function2) { //code where I use all the parametrs of function function someFunctionSubcontoller() { //here is used another function from other subcontroller } }
Is it possible to send functions as parameters? Everything is in order, am I not returning anything from the subcontrollers because $ scope is watching everything? Am I using some contoller functions in another?
Now I see that it’s neither good nor right , but I need to separate the main controller, because it contains more than 10 thousand lines of code.
Thanks for the advice and help !!!
javascript angularjs code-organization
user3917453
source share