(function(angular) {
    'use strict';

    var moduleName = '{{angularModuleName}}.mocked';

    angular
        .module(moduleName, ['ngMockE2E'])
        .run(['apiUrl', '$httpBackend', function(apiUrl, $httpBackend) {
        {{#each resourceOperations}}
            {{#each this}}
                $httpBackend.when{{action}}(apiUrl + '{{path}}').respond({{{mockedResponse}}});
            {{/each}}
        {{/each}}
        }]);

    if( typeof exports !== 'undefined' ) {
        if (typeof module !== 'undefined' && module.exports) {
            exports = module.exports = moduleName;
        }
        exports = moduleName;
    }
})(angular);

(function(angular) {
    'use strict';

    var moduleName = '{{ngModule}}.mocked';

    angular
        .module(moduleName, ['ngMockE2E'])
        .run(['apiUrl', '$httpBackend', function(apiUrl, $httpBackend) {
        {{#each resourceOperations}}
            {{#each this}}
                $httpBackend.when{{action}}(apiUrl + '{{path}}').respond({{{mockedResponse}}});
            {{/each}}
        {{/each}}
        }]);

    if( typeof exports !== 'undefined' ) {
        if (typeof module !== 'undefined' && module.exports) {
            exports = module.exports = moduleName;
        }
        exports = moduleName;
    }
})(angular);

Add ngModule to mocked template as module name
Add ngModule to mocked template as module name
