-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[0.8] dom-module nice but not perfect #1380
Comments
or if the style is going to mess with the other styles then you could do it like this <dom-style polymer="template-me template-me2">
div { color: red }
</dom-style>
<dom-template polymer="template-me">
<div>This is local DOM</div>
</dom-template>
<script>
Polymer({is: "template-me"});
</script> You can share dom styles if the polymer attribute allows to define more than one template |
I'd rather see everything inside , script and css like the way On Tue, Apr 7, 2015 at 6:12 PM Gert Cuykens [email protected]
|
I'd love to see a well documented public facing imperative api for what dom-module is solving. |
<style id="template-style">
div { color: red }
</style>
<template id="template-me">
<div>This is local DOM</div>
</template>
<script>
Polymer({template: "template-me", style:"template-style"});
</script> |
In the example provided, <dom-module id="register-me">
<template>
<div>Hello from my local DOM</div>
</template>
</dom-module>
<script>
Polymer({is: "register-me"});
</script> I don't see the point of having the id attribute on dom-module ( |
Hi This seems to work without the <link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<dom-module>
<link rel="import" type="css" href="example-element.css">
<template>
<paper-button on-tap="hello">Example Element</paper-button>
</template>
<script>
Polymer({
is:'example-element',
hello:function(){ alert('hello!');}
});
</script>
</dom-module> |
that's great as it's more DRY like 0.5. seems silly over one value, but i On Fri, Apr 17, 2015 at 2:33 PM Jon Geho [email protected] wrote:
|
I think @jongeho1's example works because of a (deprecated) method of declaring an element where it used a template immediately preceding the script tag. I would not rely on this continuing to work. I think the point of having an ID on the dom-module is that it lets you deliver the HTML and JavaScript separately. But maybe @sorvell or @kevinpschaaf can shed more light on the reasoning here. |
Thanks @arthurevans. Sounds like there are implications. For custom elements, I think this syntax works well and offers more structure in the composition. Javascript, HTML and CSS may be externalized for development and brought together with a vulcanize. The other syntax is not too far off so not a big deal but be interested to know how long that flavor has to live. |
We're investigating supporting a DRY version of |
The example you mentioned
template-me
what actually indicates already a bit what I mean by perfect.Nice
Perfect
The text was updated successfully, but these errors were encountered: