Created
March 8, 2017 12:29
-
-
Save tomalec/17ec6dec939720cad3f6d559ce1080d7 to your computer and use it in GitHub Desktop.
Starcounter App's View example
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
| <!-- dependencies goes here--> | |
| <template> | |
| <!-- All content/functional/meaningful elements goes here --> | |
| <template is="starcounter-composition"> | |
| <!-- Shadow DOM layuout goes here --> | |
| </template> | |
| </template> | |
| <!--- VanillaJS example --> | |
| <link rel="import" href="/sys/puppet-redirect/puppet-redirect.html" /> | |
| <template> | |
| <button>Click me to redirect</button> | |
| <link is="puppet-redirect" history rel="#" /> | |
| <script> | |
| (function(){ | |
| let script = document._currentScript || document.currentScript; | |
| let link = script.previousElementSibling; | |
| let button = link.previousElementSibling; | |
| button.addEventListener('click', function(){ | |
| link.setAttribute('url', '/go/somewhere'); | |
| }); | |
| })(); | |
| </script> | |
| <template is="starcounter-composition"> | |
| <div style="border: 1px solid red;"> | |
| <slot name="MyApp/button"></slot> | |
| </div> | |
| </template> | |
| </template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment