Reputation: 65373
Is there some way to programmatically create a Polymer element that has no manifestation in the DOM, such as <polymer-ajax>
?
I'm interested in this because doing Ajax requests via <polymer-ajax>
is annoying in situations where you're doing something like:
Upvotes: 2
Views: 1259
Reputation: 24119
You can instantiate custom elements just as you can existing native HTML elements. Have you tried var el = document.createElement('polymer-ajax');
? The only (potential) gotcha with Polymer elements is that its special features like {{}}
bindings and *Changed
handlers get cleaned up over time if the element is never added to the DOM.
http://www.polymer-project.org/polymer.html#bindings
Upvotes: 4