I just started working at Polymer. Two events seem to indicate that the content is ready:
app.addEventListener('dom-change', function() {
console.log('Our app is ready to rock!');
});
window.addEventListener('WebComponentsReady', function() {
});
I wonder if they need to be combined and put the code inside to make sure the document is fully loaded before making any script, for example:
app.addEventListener('dom-change', function() {
window.addEventListener('WebComponentsReady', function() {
});
});
However, I do not know how to do it correctly in all browsers. If WebComponentsReady occurs before the dom change, inside the script is never executed.
Hell, that might not even be necessary, because the polymer starter kit doesn't wrap them together. In this case, what script types should go inside the event dom-changeand what script types should go inside the event WebComponentsReady?
source
share