Reputation: 13
How to get full list of polymer-element's which was imported before?
Upvotes: 0
Views: 97
Reputation: 1999
Import de-duplication allows you to not have to worry about this in general.
you could also have X-Tags, raw custom elements, or any other kind.
Example:
var allElements = document.all;
var polymerElements = [];
for (var i = 0; i< allElements.length; i++){
var tagName = allElements[i].localName;
if(tagName && tagName.indexOf('polymer-') > -1){
polymerElements.push(tagName);
}
}
console.log(polymerElements);
Upvotes: 1