Commit 5aad4d27 authored by Bertrand PINEL's avatar Bertrand PINEL

First application with static data

parent 4ffb94ee
......@@ -7,6 +7,7 @@ const Router = Ember.Router.extend({
});
Router.map(function() {
this.route('racks');
});
export default Router;
import Ember from 'ember';
let racks = [
{
name: 'Standard grey Rack',
nbColumns: 6,
nbRows: 4,
image: './img/rack_01.jpg'
},
{
name: 'Traditional big Rack',
nbColumns: 10,
nbRows: 10,
image: './img/rack_02.jpg'
},
{
name: 'Small Wood Rack',
nbColumns: 3,
nbRows: 4,
image: './img/rack_03.jpg'
}
];
export default Ember.Route.extend({
model() {
return racks;
}
});
<h2>List of Racks</h2>
<div class="detail">
{{#each model as |rack|}}
<article class="listing">
<h3>{{rack.name}}</h3>
<div class="detail">
<span>Nb Colums:</span> {{rack.nbColumns}}
<span>Nb Rows:</span> {{rack.nbRows}}
</div>
<div class="detail">
<img src={{rack.image}} width='235px' height='235px'/>
</div>
</article>
{{/each}}
{{outlet}}
</div>
import { moduleFor, test } from 'ember-qunit';
moduleFor('route:racks', 'Unit | Route | racks', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
test('it exists', function(assert) {
let route = this.subject();
assert.ok(route);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment