Skip to content

Instantly share code, notes, and snippets.

@AndrewHenderson
Created February 16, 2013 02:26
Show Gist options
  • Save AndrewHenderson/4965209 to your computer and use it in GitHub Desktop.
Save AndrewHenderson/4965209 to your computer and use it in GitHub Desktop.
var App = Ember.Application.create();
App.ApplicationView = Ember.View.extend({
templateName: 'application'
});
App.AllContributorsView = Ember.View.extend({
templateName: 'contributors'
});
App.Router.map(function(){
this.route('contributors');
})
App.IndexRoute = Ember.Route.extend({
setupController: function(controller) {
controller.set('title', "Ember Contributors");
}
})
App.ContributorsRoute = Ember.Route.extend({});
App.Contributor = Ember.Object.extend({
name: "Andrew Henderson"
})
App.initialize();
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Ember</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/style.css?v=2">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<script type="text/x-handlebars" data-template-name="application">
<h1>{{name}}</h1>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="contributors">
{{#each person in controller}}
{{person.login}}
{{/each}}
</script>
<script type="text/javascript" src="js/vendor/jquery/jquery.js"></script>
<script type="text/javascript" src="js/vendor/handlebars/handlebars.js"></script>
<script type="text/javascript" src="js/vendor/ember/ember.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment