For better organization and ease of editing, I've structured my Angular application into separate files. Here's a snippet from my app.js where I define the dependencies:
app.js
var app = angular.module('app', ['ngResource', 'ngRoute', 'app.services', 'app.controllers', 'app.feed','app.directives', 'app.factories']);
app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
...
}]);
This is how I've set up the dependencies in one of the files:
services.js
var app = angular.module('app.services', []);
app.factory('AuthService', ['$scope'], function($scope) {
...
}]);
My issue arises when concatenating the scripts as it constantly redefines the 'app' variable. While considering removing the 'var' declaration to solve this problem, I prefer keeping my files separated.
Is there a way to maintain the integrity of dependency injections in my app.js while preserving the segregation of files?