Last active
August 29, 2015 14:11
-
-
Save aquajach/3529e5a7541620ad5e8f to your computer and use it in GitHub Desktop.
Is it possible?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 --!> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.