The correct answer is that it does not matter. Although the documentation is valid, as @Mowzer noted, this is just an example, not a definition. At least some actual polymer elements, such as e. Mr. iron-image have it outside of the dom module.
The connection between the dom module and the constructor constructor of an object is established using the 'is' property of the object passed to the Polymer constructor and the id attribute of the dom module.
From the Local DOM guide :
Give <dom-module> the id attribute that corresponds to its elements, is a property and places inside <dom-module>. The polymer automatically clones this template content into local DOM elements.
As an additional note, you can also successfully use <script src = "external.js"> </script> to separate html from JS - I just guess that this is one of the possible reasons for this question. The only drawback to this (AFAIK) is that in this case, the vulcanized version of your element will display incorrect (offset) line numbers of code for JS errors.
Igor R
source share