EMBER WORKSHOP: RSVP.hash simple

Views w/ RSVP.hash

by jdcravens

HTML

<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/tags/v1.9.0/ember.js"></script>
<script type="text/x-handlebars">
    {{outlet}}
</script>

<script type="text/x-handlebars" data-template-name="index">
    <div class="wrapper">
        <p>{{currentTime}}</p>
        <p>{{categoryName}}</p>        
    </div>
</script>

SCSS

body {
    font-family: Optima, serif;
}

code {
    color: gainsboro;
    background-color: ghostwhite;
}

.wrapper {
    overflow: hidden;
    padding: 10px;
}

.column {
    box-sizing: border-box;
    float: left;
    width: 50%;
    padding: 10px;
    border-right: 1px solid #ccc;
    &:last-child {
        border-right: none;
    }
}

JavaScript

var App = Ember.Application.create({
    //LOG_TRANSITIONS: true,
    //LOG_RESOLVER: true,
    //LOG_ACTIVE_GENERATION: true, // log whats being actively generated
    //LOG_MODULE_RESOLVER: true, 
    //LOG_TRANSITIONS: true,
    //LOG_TRANSITIONS_INTERNAL: true,
    //LOG_VIEW_LOOKUPS: true 
});

App.IndexRoute = Ember.Route.extend({
  model: function() {
    return Ember.RSVP.hash({
      currentTime: new Date().toISOString(),
      categoryName: 'Category No.1'
    });
  }
});