Created
June 6, 2011 19:25
-
-
Save scottmessinger/1010893 to your computer and use it in GitHub Desktop.
Handlebars in Sproutcore
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
Hi Tom and Yehuda, | |
I like html. I like handlebars. I don't like what Sproutcore does with handlebars. In the example below, it appears that Sproutcore modifies #each to automatically insert li tags. I find this aggravating. I want Sproutcore to handle my data, DOM updates, etc and let me worry about markup. By their nature, helper methods are not transparent and make it difficult for designers to mark up a page for a SC app. | |
I like using data-attr because they respect MY markup. I can get behind handlebars in SC if it can also respect my markup. | |
Thanks for dialoging about this. I really want to use SC...I just can't get over the view complexity at this point. | |
Thanks! | |
Scott | |
From: http://guides.sproutcore20.com/using_handlebars.html | |
{{#each people}} | |
Hello, {{name}}! | |
{{/each}} | |
This will print a list like this: | |
<ul> | |
<li>Hello, Steph!</li> | |
<li>Hello, Tom!</li> | |
</ul> | |
From: http://handlebars.strobeapp.com/ | |
<ul class="people_list"> | |
{{#each people}} | |
<li>{{this}}</li> | |
{{/each}}}} | |
</ul> | |
<ul class="people_list"> | |
<li>Yehuda Katz</li> | |
<li>Alan Johnson</li> | |
<li>Charles Jolley</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment