Ember Starter Kit

by Dogbert

HTML

<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.1.2.js"></script>
<script src="http://builds.emberjs.com/tags/v1.9.1/ember.min.js"></script>
<script type="text/x-handlebars">
    <h2>Welcome to Ember.js</h2>

    {{outlet}}
  </script>

  <script type="text/x-handlebars" data-template-name="index">
    <ul>
    {{#each item in model}}
      <li>{{item}}</li>
    {{/each}}
    </ul>
  </script>

CSS

/* Put your CSS here */
 html, body {
    margin: 20px;
}

JavaScript

App = Ember.Application.create();

App.Router.map(function () {
    // put your routes here
});

App.IndexRoute = Ember.Route.extend({
    model: function () {
        return App.Package.FIXTURES;
//        return this.store.find('package');
//        return ['red', 'yellow', 'blue'];
    }
});

App.Package = Ember.Model.extend({
    name: DS.attr('string'),
    version: DS.attr('string'),
    description: DS.attr('string'),
    modules: DS.hasMany('module')
});

App.Module = Ember.Model.extend({
    name: DS.attr('string'),
    // info: DS.attr,
    description: DS.attr('string'),
//     interface
});

App.PackagesRoute = Ember.Route.extend({
    model: function() {
        return this.store.find('package');
    }
});

App.Package.FIXTURES = [{
  "name": "unordered-containers",
  "version": "0.2.5.1",
  "description": "Efficient hashing-based container types",
  "modules": [
    {
      "name": "Data.HashMap.Lazy",
      "info": {
        "Copyright": "2010-2012 Johan Tibell",
        "License": "BSD-style",
        "Maintainer": "[email protected]",
        "Stability": "provisional",
        "Portability": "portable",
        "Safe Haskell": "Trustworthy",
        "Language": "Haskell98"
      },
      "description": "<p>A map from <em>hashable</em> keys to values.  A map cannot contain\n duplicate keys; each key can map to at most one value.  A <code><a href=\"/package/unordered-containers/0.2.5.1/Data.HashMap.Lazy/HashMap\">HashMap</a></code>\n makes no guarantees as to the order of its elements.</p>\n<p>The implementation is based on <em>hash array mapped tries</em>.  A\n <code><a href=\"/package/unordered-containers/0.2.5.1/Data.HashMap.Lazy/HashMap\">HashMap</a></code> is often faster than other tree-based set types,\n especially when key comparison is expensive, as in the case of\n strings.</p>\n<p>Many operations have a average-case complexity of <em>O(log n)</em>.  The\n implementation uses a large base (i.e. 16) so in practice these\n operations...