Hey I am kind a newbie to ember and I am looking for a help: Here is my json file:
{ “id”: 1, “title”: “Grand Old Mansion”, “owner”: “Veruca Salt”, “city”: “San Francisco”, “type”: “Estate”, “bedrooms”: 15, “image”: “https://upload.wikimedia.org/wikipedia/commons/c/cb/Crane_estate_(5).jpg” }
my model:rental.js import DS from ‘ember-data’;
export default DS.Model.extend({ title: DS.attr(), owner: DS.attr(), city: DS.attr(), type: DS.attr(), image: DS.attr(), bedrooms: DS.attr() });
and my index.hbs:
{{#each model as |rental|}}
{{rental.title}}
Owner: {{rental.owner}}
Type: {{rental.type}}
Location: {{rental.city}}
Number of bedrooms: {{rental.bedrooms}}
{{/each}}and my index.js route:
import Ember from ‘ember’;
export default Ember.Route.extend({ model() {
}, });
Now i have been surfing around internet to explain me how can I connect my json file so my ember app can detect data from it and index.js model can route to index.hbs