on the emberjs home page it shows how easy everything is! it’s only 13 lines of js!
ok let’s dive right in! I’m excited!
step 1. ember.js isn’t actually included here hmm i guess we’ll need that
step 2. where does this js go? let’s put it in some random file, main.js
step 3. where does this template go? probably in the dom! ok so now we have
<html>
<head>
<script src="ember.js"></script>
<script src="main.js"></script>
</head>
<body>
<h1>People</h1>
<ul>
{{#each peopleController}}
<li>Hello, <b>{{fullName}}</b>!</li>
{{/each}}
</ul>
</body>
</html>
Ok this doesn’t work at all. Let’s look at the console I guess?
'Uncaught Error: assertion failed: Ember Views require jQuery 1.8 or 1.9 ’ - are you serious? ooook let’s add that…
‘Uncaught Error: assertion failed: Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater’ - oh god this is going to be fun, isn’t it?
let’s say we figured out that we also need to put handlebars in that weird script tag…
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="ember.js"></script>
<script src="handlebars.js"></script>
<script src="main.js"></script>
</head>
<body>
<script type="text/x-handlebars">
...
</script>
</body>
</html>
'Uncaught Error: assertion failed: Ember Handlebars requires Handlebars 1.0.0-rc.3 or greater ’ - what did I do wrong? …
oh I guess, handlebars needs to go before ember. ok fine. moving on…
‘Uncaught ReferenceError: App is not defined’ - for the love of … ok let’s do some googling …
by the awful grace of god we figure out to add this line to the top of main.js…
var App = Ember.Application.create();
'Uncaught ReferenceError: DS is not defined ’ - ok, this is insane. Let’s go to ‘API’ ( http://emberjs.com/api/ ) to figure out what DS is supposed to be
I would guess it means data store? but there’s nothing like that on ‘API’…
You know what? Let’s just go to ‘guides’ and load the quick start tutorial. Ok, there’s no quick start. great! Let’s uh… try to find something. Core concepts? Guys, I just want to run a little toy app test. Handlebars basics? … Should I be crying right now or is that unexpected user behavior?
Let’s google for emberjs tutorial! Someone must have done this before. Oh good, top result ! trek.github.com ! “this article has been removed.” super cool! back to google! second result is a SO quesiton! oh good! No code at all! OH GOOD! Oh good, there’s 3 more results linking to the first dead article! FANTASTIC!
Can I just has quickstart guide please? I’m going to bed now sad, because I thought I’d have an ember app up and running in a few minutes, but it’s not quite as trivial as the 13 lines of js make it out to be apparently.