'use strict';

var _ = require('lodash');

module.exports = function(GulpAngularGenerator) {

    /**
     * Compute Angular's other modules to load and format the dependency list to insert
     */
    GulpAngularGenerator.prototype.computeOtherModules = function computeOtherModules() {

        // angular-translate
        if(_.includes(this.props.otherModulesKeys, 'translate')) {
            this.files.push({
                src: 'config/languages/_en.json',
                dest: 'config/languages/en.json',
                template: true
            });

            this.files.push({
                src: 'config/languages/_fr.json',
                dest: 'config/languages/fr.json',
                template: true
            });
        }

        // Injections
        var injections = this.props.otherModules.map(function(module) {
            return module.inject;
        })[0];
        
        injections.push('$logProvider');

        this.props.baseInjectionsQuotes = '';
        this.props.baseInjections = '';
        if(injections !== undefined) {
            this.props.baseInjectionsQuotes = injections
                .map(function(dependency) {
                    return '\'' + dependency + '\'';
                })
                .join(', ');
            this.props.baseInjections = injections.join(', ');
        }
    };
};

@@ -887,24 +887,25 @@
  %7D)%5B0%5D;%0A
+%0A
         
 %0A       
@@ -900,49 +900,188 @@
     
-%0A        injections.push('$logProvider');
+if (typeof injections !== 'undefined' && injections.length %3E 0) %7B%0A            injections.push('$logProvider');%0A        %7D else %7B%0A            injections = %5B'$logProvider'%5D;%0A        %7D
 %0A%0A  

Fix injections missing test