Skip to content
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

Develop a true Web Component version of time-elements #81

Closed
hjoelr opened this issue May 1, 2017 · 2 comments
Closed

Develop a true Web Component version of time-elements #81

hjoelr opened this issue May 1, 2017 · 2 comments

Comments

@hjoelr
Copy link

hjoelr commented May 1, 2017

I'm trying to use time-elements in an application built on top of Polymer (2.0) and Web Components and I can't seem to get this to work since there is no real web component defined for these custom HTML tags. I know this is added to the Web Components website but it only has the .js file and no HTML files to import. My request is two-fold:

  1. Make full-blown Web Components for each custom HTML tag (eg. <relative-time>, <local-time>, etc.) with HTML imports.
  2. Is there a way to properly use the current implementation in a Polymer 2.0 Web Component?

Thank you for your work!

Edit: I forgot to mention that I'm relatively new to Web Components and Polymer so it's very possible that I'm missing something and time-elements in its current form is already a real web component and I just don't realize it.

@hjoelr
Copy link
Author

hjoelr commented May 1, 2017

After some searching I found out what my problem was from Issue #54 . Apparently Polymer was not binding my variable to the datetime attribute because I wasn't using the attribute binding syntax of $= instead of just the =. So, in my case I needed to use something like datetime$=[[bindingVariable]] and that worked.

As for where to reference the time-elements.js, I was able to include it in my top-level Web Component component and it found my <relative-time> tag inside a child Web Component. I wasn't sure that would work, but that's because I'm still learning Web Components.

So, I've resolved point 2 above, but it would still be really helpful to create real HTML imports instead of having to import the script directly.

@dgraham
Copy link
Contributor

dgraham commented Jan 9, 2018

Time elements now use the v1 custom element API: #85 (comment).

@dgraham dgraham closed this as completed Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants