Last active
August 29, 2015 14:23
-
-
Save stefek99/c3433da8fdcb1c5e01bf to your computer and use it in GitHub Desktop.
Ember Data Starter Kit
This file contains hidden or 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> | |
| </head> | |
| <body> | |
| <script type="text/x-handlebars"> | |
| <h2>Ember Starter Kit</h2> | |
| {{outlet}} | |
| </script> | |
| <script type="text/x-handlebars" id="index"> | |
| <ul> | |
| {{#each item in model}} | |
| <li>{{item.name}}</li> | |
| {{/each}} | |
| </ul> | |
| </script> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | |
| <script src="http://builds.emberjs.com/tags/v1.13.2/ember.debug.js"></script> | |
| <script src="http://builds.emberjs.com/tags/v1.13.2/ember-template-compiler.js"></script> | |
| <script src="http://builds.emberjs.com/tags/v1.0.0-beta.19.2/ember-data.js"></script> | |
| <!-- | |
| <script src="http://builds.emberjs.com/tags/v1.13.2/ember-data.js"></script> | |
| CANNOT USER LATEST VERSION OF EMBER DATA AS THE FIXTURE ADAPTER HAS BEEN REMOVED | |
| See breaking changes: https://github.com/emberjs/data/blob/master/CHANGELOG.md#breaking-changes | |
| "You can use it as an addon, or build it using Ember Giftwrap." - for now just resolving to an old Ember Data version | |
| See also my rant about removal: http://discuss.emberjs.com/t/ember-data-removal-of-fixture-adapter-many-of-the-examples-tutorials-will-break/8224 | |
| --> | |
| <script> | |
| App = Ember.Application.create(); | |
| App.Router.map(function() { | |
| // put your routes here | |
| }); | |
| App.Color = DS.Model.extend({ | |
| name: DS.attr('string') | |
| }).reopenClass({ | |
| FIXTURES: [ | |
| { | |
| id: 1, | |
| name: "Pink" | |
| }, | |
| { | |
| id: 2, | |
| name: "Salmon" | |
| }, | |
| ] | |
| }); | |
| App.ColorAdapter = DS.FixtureAdapter.extend({}); | |
| App.IndexRoute = Ember.Route.extend({ | |
| model: function() { | |
| return this.store.find('color'); | |
| } | |
| }); | |
| App.IndexController = Ember.Controller.extend({ | |
| actions : { | |
| } | |
| }); | |
| </script> | |
| <style> | |
| </style> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment