From b353045019151b225643e6080b2b916b94da35e1 Mon Sep 17 00:00:00 2001 From: Matt Mo Date: Wed, 11 Aug 2021 10:46:00 -0700 Subject: [PATCH] Added a set properties function to IgniteElement to help populate an element's events quickly. --- ignite-element.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ignite-element.js b/ignite-element.js index 1ec726d..8f905e6 100644 --- a/ignite-element.js +++ b/ignite-element.js @@ -167,6 +167,13 @@ class IgniteElement extends HTMLElement { return ret; } + /** + * Sets all the property values on this element. + */ + setProperties(props) { + Object.keys(props).forEach(name => this[name] = props[name]); + } + /** * Creates the getters/setters for properties in this * ignite element and initializes everything.