I'm looking for a way to determine what attributes a polymer element has without interacting with the attributes directly. I stumbled upon this.attributes
accidentally and it does contain all the information that I need It's just not very pretty. I was wondering if there was a simple attributes object that existed already. Something simple like this.
{
"src": "http://stackoverflow.com/image.jpg",
"alt": "stackoverflow"
}
Here's how you'd convert it using underscore, it's a little ugly.
this.attr_obj = _.extend.apply(null, _.map(this.attributes, function(attribute){
var temp = {};
temp[attribute.name] = attribute.value;
return temp;
}));