Skip to content

Instantly share code, notes, and snippets.

@bmelton
Created April 5, 2012 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmelton/2313467 to your computer and use it in GitHub Desktop.
Save bmelton/2313467 to your computer and use it in GitHub Desktop.
A Gentle Introduction to Ember - Wrapup
<!doctype html>
<head>
<title>Ember test</title>
<script type="text/javascript" src="../lib/jquery.min.js"></script>
<script type="text/javascript" src="../lib/ember.min.js"></script>
</head>
<body>
<script type="text/x-handlebars">
<img {{bindAttr src="Example.logo"}} alt="Logo"><br />
<h1>{{ Example.name }}</h1>
{{#view Example.LoopingView id="looping-view" }}
{{#each items}}
<li>Hello, {{ name }}!</li>
{{/each}}
{{/view }}
</script>
<script>
Example = Ember.Application.create({
name: "Example Application",
logo: "http://sympodial.com/images/logo.png"
});
Example.Item = Ember.Object.extend();
var items = [
Example.Item.create({ name: "Barry" }),
Example.Item.create({ name: "Misty" }),
Example.Item.create({ name: "Derrick" })
]
Example.LoopingView = Ember.View.extend({
items: items
});
</script>
</body>
</html>
@bmelton
Copy link
Author

bmelton commented Apr 6, 2012

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