Created
June 10, 2018 16:34
-
-
Save sanjsanj/816a0b41991a8a9e48326843fa122eb8 to your computer and use it in GitHub Desktop.
This file contains 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
<amp-state id="state" [src]="remoteState"> | |
<script type="application/json"> | |
{ | |
"name": "General Leia Organa-Solo" | |
} | |
</script> | |
</amp-state> | |
<h1 [text]="state.name">General Leia Organa-Solo</h1> | |
<button | |
on="tap:AMP.setState({ | |
remoteState: 'https://swapi.co/api/people/' + ((random() * 10).toFixed() * 5) + '/?format=json' | |
})"> | |
Random Star Wars Character | |
</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment