Skip to content

Instantly share code, notes, and snippets.

@aquajach
Last active August 29, 2015 14:11
Show Gist options
  • Save aquajach/3529e5a7541620ad5e8f to your computer and use it in GitHub Desktop.
Save aquajach/3529e5a7541620ad5e8f to your computer and use it in GitHub Desktop.
Is it possible?
<youtube-video data-code='hkk68&$'></youtube-video>
<template>
<iframe src="http://youtube.com/#{youtube-code}/"></iframe>
</template>
<!-- I want use the youtube-video element with code to get the iframe of of YouTube video --!>
<!-- Is it possible to make youtube-code in template generic as a variable whose value is data-code in youtube-video? --!>
<!-- The template is more complex than above in reality by the way --!>
@robdodson
Copy link

I see.

I think you'd want to use javascript to do this. querySelector for the youtube-video, get its data-code, then when you clone the content of your template, querySelector for the iframe and set its src.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment