Created
April 19, 2017 18:33
-
-
Save Kamilnaja/92a5f259b25d59f7dc1ca057085caae2 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
<div id="quoteData"></div> | |
<script id="quote-template" type="text/x-handlebars-template"> | |
<h3>Favorite {{name}} Quotes</h3> | |
<ol> | |
{{#each quotes }} | |
<li>{{quote}}</li> | |
{{/each}} | |
</ol> | |
</script> | |
<script> | |
var quoteInfo = document.getElementById("quote-template").innerHTML; | |
var template = Handlebars.compile(quoteInfo); | |
var quoteData = template({ | |
name: "Yogi Berr", | |
quotes: [ | |
{quote: "Bądź wdzięczny za to, co masz, a będziesz miał tego więcej. Jeśli koncentrujesz się na tym, czego nie masz, nigdy nie będziesz miał wystarczająco dużo. - Oprah Winfrey"}, | |
{ | |
quote: "Szanse nigdy nie ulegają zatraceniu. Jeśli Ty ich nie wykorzystasz, wykorzysta je ktoś inny. - przysłowie chińskie" | |
}, | |
{ | |
quote: "Postępuj zawsze tak, jakby to czynisz, miało być twoim ostatnim uczynkiem. - Elias Canetti" | |
} | |
] | |
}); | |
document.getElementById("quoteData").innerHTML += quoteData; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment