Showing
1 changed file
with
4 additions
and
2 deletions
@@ -32,9 +32,11 @@ export default function EntitySelect($compile, $templateCache, entityService) { | @@ -32,9 +32,11 @@ export default function EntitySelect($compile, $templateCache, entityService) { | ||
32 | 32 | ||
33 | var entityTypes = entityService.prepareAllowedEntityTypesList(scope.allowedEntityTypes, scope.useAliasEntityTypes); | 33 | var entityTypes = entityService.prepareAllowedEntityTypesList(scope.allowedEntityTypes, scope.useAliasEntityTypes); |
34 | 34 | ||
35 | - if (entityTypes.length === 1) { | 35 | + var entityTypeKeys = Object.keys(entityTypes); |
36 | + | ||
37 | + if (entityTypeKeys.length === 1) { | ||
36 | scope.displayEntityTypeSelect = false; | 38 | scope.displayEntityTypeSelect = false; |
37 | - scope.defaultEntityType = entityTypes[0]; | 39 | + scope.defaultEntityType = entityTypes[entityTypeKeys[0]]; |
38 | } else { | 40 | } else { |
39 | scope.displayEntityTypeSelect = true; | 41 | scope.displayEntityTypeSelect = true; |
40 | } | 42 | } |