Skip to content

Instantly share code, notes, and snippets.

@paul
Created August 21, 2011 03:24
Show Gist options
  • Save paul/1160063 to your computer and use it in GitHub Desktop.
Save paul/1160063 to your computer and use it in GitHub Desktop.

Sproutcore 2.0 questions

I'm trying to write a complicated app in SC2. There's no editing component yet, just a display of (lots of data). Starting from the Todos & Handlebars guides, here's some of the stuff I've had to google for, or wasn't readily obvious.

Note: I like coffeescript and haml

  • Why is there sometimes references to SC.ArrayController?

    • Colin C: it was gone but its back now. we need to generate the docs again.
  • Why is App.fooController an SC.Object, and App.foosController an SC.ArrayProxy? Shouldn't there just be a generic SC.Controller, or SC.CollectionController, if the behavior is different?

  • How do I nest controllers? Eg, BlogApp.postsController and BlogApp.commentsController, where I want to display several posts and their comments on the page?

    • How do I organize the view templates? What do I say in the post template where I want the comments to go?
  • If I follow the handlebars guide, and put <script type="text/x-handlebars" ...> in the <head>, how do I specify where to put the rendered result? Eg, if I have a div#content, how do I tell SC I want the template rendered there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment