I am trying to learn Ember using the docs here: http://emberjs.com/guides/templates/handlebars-basics/
I am following the example given on that link and accordingly have the following two files and contents and nothing else. However, when I go the browser and open index.html I do not see Hello World. The World part does not show up. However, according to what is explained near the bottom of that page, World should show up on the page.
Any help in understanding why this is not working would be great. Thanks!
index.html
<h2>First Ember Application</h2>
<script type="text/x-handlebars">
Hello {{name}}.
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.1/handlebars.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-pre.2/ember-1.0.0-pre.2.min.js"></script>
<script src="app.js"></script>
</body>
</html>
app.js
window.App = Ember.Application.create();
App.ApplicationController = Ember.Controller.extend({
name: "World"
});
you would need an Ember.View to pass variables into and connect with the template. You could set the Context of the controller and have the view use this as its contents, but for your simple example:
Its worth noting that Ember will look for a set of View, Controller and template with the ‘application’ naming convention.
Here is a link to the full fiddle http://jsfiddle.net/gNKJj/1/