So, I check Emberjs .
Scroll a little on the main page: "GETTING STARTED WITH EMBER.JS EASY".
Great, it looks simple, I'll give it back.
Create a new HTML5 template file.
Paste the code of your template into mine:
<body></body>
Enable emberjs:
<script src="ember.js" type="text/javascript"></script>
Include the JS code they provided in:
<script type="text/javascript"></script>
In my tags. Great, let's see what happens.
Download the page, the console will tell me that it requires jquery. Therefore, there is no problem with jQuery. Try again, another mistake, I need to turn on the steering wheels. No problem, I turn on the steering wheel. Try again, the application is not defined ... correctly ... so I turn on
window.App = Ember.Application.create();
Above the fragment they provided. Try again, DS not defined. At the moment, I have no idea where to go next. I took a look at the emberjs guide section as I assume that I should define a DS model somewhere or something else. But the leadership was useless.
Am I missing something obviously obvious, or is it really not "easy" as they put it? What do I need to do to make this basic example work (and why the hell did they give the "basic" code that doesn't work in this example)?
Edit:
My full code is:
<!DOCTYPE html> <html> <head> <script src="jquery.js" type="text/javascript"></script> <script src="handlebars.js" type="text/javascript"></script> <script src="ember.js" type="text/javascript"></script> <script type="text/javascript"> window.App = Ember.Application.create(); App.Person = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'), fullName: function() { return this.get('firstName') + " " + this.get('lastName'); }.property('firstName', 'lastName') }); App.peopleController = Em.ArrayController.create({ content: App.Person.findAll() }); </script> </head> <body> <h1>People</h1> <ul> {{#each peopleController}} <li>Hello, <b>{{fullName}}</b>!</li> {{/each}} </ul> </body> </html>