I have the folder structure as in the image.
And I have 2 controllers in 2 different folders. And it seems they 2 gets conflicted and the first controller pages are not working if I include the 2nd controller in index.html as below. Only if I remove the second controller the first one works.
index.html
<script src="1_reportingEntities/controller.js"></script>
<script src="2_dataCollections/controller.js"></script>
Folder structure
Updated:
Here are the 2 controllers and both have the same file name in different folders.
controller.js
'use strict';
var mdmApp = angular.module('mdmApp', ['ngRoute', 'ngResource', 'ngMessages', 'ui.grid', 'ui.grid.pagination',
'ui.grid.moveColumns', 'ui.grid.resizeColumns', 'ui.grid.selection', 'ui.grid.autoResize',
'ui.grid.cellNav', 'ui.grid.exporter', '720kb.datepicker','angularjs-dropdown-multiselect']);
mdmApp.config(function($routeProvider) {
$routeProvider.when('/', {
templateUrl : '1_reportingEntities/listEntities.html',
controller : "listController"
})
.when('/list', {
templateUrl : '1_reportingEntities/listEntities.html',
controller : "listController"
})
controller.js
'use strict';
var mdmApp = angular.module('mdmApp', ['ngRoute', 'ngResource', 'ngMessages', 'ui.grid', 'ui.grid.pagination',
'ui.grid.moveColumns', 'ui.grid.resizeColumns', 'ui.grid.selection', 'ui.grid.autoResize',
'ui.grid.cellNav', 'ui.grid.exporter', '720kb.datepicker','angularjs-dropdown-multiselect']);
mdmApp.config(function($routeProvider) {
$routeProvider.when('/dataCollection', {
templateUrl : '2_dataCollections/dataCollection.html',
controller : "dataCollectionController"
})
.when('/reportTypeEntityList/:id', {
templateUrl : '2_dataCollections/reportTypeEntityList.html',
controller : 'reportListController',
resolve : {
formType : function() {
return 'REPORTTYPEENTITYLIST';
}
}
})
