Created
August 7, 2014 17:55
-
-
Save Andrew-Max/ad28f7f795785288cafd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ember Starter Kit</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script> | |
<script src="http://builds.emberjs.com/tags/v1.6.1/ember.js"></script> | |
<script src="http://builds.emberjs.com/beta/ember-data.js"></script> | |
</head> | |
<body> | |
<script type="text/x-handlebars"> | |
<h2>Welcome to Ember.js</h2> | |
{{outlet}} | |
</script> | |
<script type="text/x-handlebars" data-template-name="index"> | |
<p>Trying to list all albums in an unrelated view</p> | |
<div class="library-links album-links"> | |
{{#each App.albumsController}} | |
{{title}} | |
{{/each}} | |
</div> | |
</div> | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = Ember.Application.create(); | |
App.ApplicationAdapter = DS.FixtureAdapter; | |
App.Router.map(function () { | |
this.route('inbox'); | |
this.resource('album', { path: '/albums/:id' }); | |
}); | |
App.Album = DS.Model.extend({ | |
title: DS.attr() | |
}); | |
App.Album.FIXTURES = [ | |
{ | |
id: 1, | |
title: "zeta" | |
}, | |
{ | |
id: 2, | |
title: "alpha" | |
}, | |
{ | |
id: 3, | |
title: "gamma" | |
}, | |
]; | |
App.albumsController = Ember.ArrayController.create(); | |
App.albumsController.set('sortProperties', ['title']); | |
App.albumsController.set('content', App.Album.FIXTURES); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment