I have a question related to bulk code on a AngularJs controller I have a controller name with userDashboard.js and I have lots of methods api calling for data for example:
1) Charts - Chart 1 ,Chart 2 Chart 3 ... etc.
2) Table - Table 1, 2 etc...
3) Section - 1 , 2 , 3 ..
I want to make separate Js file with same controller to make code readable and understandably how can i achieve this.
Is it is working if i am using same controller name for the other file like:
controller1.js
use strict';
angular.module('onepgr')
.controller('userDashboard',
function ($scope,$routeParams, MyAppService,Excel,$timeout) {
//API
//Chart
});
controller2.js
use strict';
angular.module('onepgr')
.controller('userDashboard',
function ($scope,$routeParams, MyAppService,Excel,$timeout) {
//Table function
//API
});