diff --git a/src/json-utils.js b/src/json-utils.js index d5a422ffc..f4c1a7c0e 100644 --- a/src/json-utils.js +++ b/src/json-utils.js @@ -56,7 +56,9 @@ function getAttributes (entity) { if (entity.getAttribute('mixin')) { elemObj['mixin'] = entity.getAttribute('mixin'); } - + if (entity.getAttribute('data-layer-name')) { + elemObj['data-layer-name'] = entity.getAttribute('data-layer-name'); + } const entityComponents = entity.components; if (entityComponents) { @@ -339,6 +341,10 @@ function createEntityFromObj (entityData, parentEl) { if (entityData.class) { entity.classList.add(...entityData.class); } + + if (entityData['data-layer-name']) { + entity.setAttribute('data-layer-name', entityData['data-layer-name']); + } entity.addEventListener('loaded', () => { // load attributes