Skip to content
Snippets Groups Projects
Commit 5aad4d27 authored by Bertrand PINEL's avatar Bertrand PINEL
Browse files

First application with static data

parent 4ffb94ee
No related branches found
No related tags found
No related merge requests found
......@@ -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>
public/img/rack_01.jpg

7.5 KiB

public/img/rack_02.jpg

25.9 KiB

public/img/rack_03.jpg

21.8 KiB

public/img/rack_04.jpg

24.5 KiB

public/img/rack_05.jpg

16.9 KiB

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);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment