diff --git a/generators/entity/templates/src/main/webapp/app/services/_entity.service.js b/generators/entity/templates/src/main/webapp/app/services/_entity.service.js
index <HASH>..<HASH> 100644
--- a/generators/entity/templates/src/main/webapp/app/services/_entity.service.js
+++ b/generators/entity/templates/src/main/webapp/app/services/_entity.service.js
@@ -11,7 +11,7 @@ _%>
 
     <%= entityClass %>.$inject = ['$resource'<% if (hasDate) { %>, 'DateUtils'<% } %>];
 
-    function <%= entityClass %> ($resource, DateUtils) {
+    function <%= entityClass %> ($resource<% if (hasDate) { %>, DateUtils<% } %>) {
         var resourceUrl = <% if (applicationType == 'gateway' && locals.microserviceName) {%> '<%= microserviceName.toLowerCase() %>/' +<% } %> 'api/<%= entityApiUrl %>/:id';
 
         return $resource(resourceUrl, {}, {
only inject DateUtils into angular factory when entity has a date field