Last active
August 6, 2018 05:41
-
-
Save imaustink/7162ce7cb3772c67f83da86da73ce669 to your computer and use it in GitHub Desktop.
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
<style> | |
user-media-selector { | |
box-sizing: border-box; | |
border: 1px solid #000; | |
width: 600px; | |
margin-bottom: 30px; | |
} | |
textarea { | |
width: 600px; | |
height: 200px; | |
} | |
</style> | |
<script src="./node_modules/steal/steal.js"> | |
import stache from 'can-stache' | |
import DefineMap from 'can-define/map/' | |
import '~/user-media-selector' | |
const template = stache(` | |
<user-media-selector | |
constraints:to="constraints" | |
/> | |
<div> | |
<textarea>{{stringify(constraints)}}</textarea> | |
</div> | |
`) | |
const vm = new DefineMap({ | |
stringify (object) { | |
return JSON.stringify(object, null, 2) | |
} | |
}) | |
document.body.appendChild(template(vm)) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment