vendredi 2 juin 2017

Ember simple fake service not showing up on page

I am just trying to get a service set up and ready for a REST API. I'm just using fake data just to see if I can pull it into the controller. Unfortunately, I'm not able to display the information.

I went through this documentation but I'm not able to see my return

I have my service as report.js

export default Ember.Service.extend({
    reports: [100, 96, 92, 74, 65, 64, 42, 21, 20, 19, 10, 4],
});

Then I have a controller report.js

export default Ember.Controller.extend({
    reports: Ember.inject.service('report')
});

Then in my hbs file, I have:

<div>
    
    <span></span>
    
</div>

When I load the page, I don't see anything, though I should see a group of numbers. If I go into the ember inspector in chrome, I can go to container > service > reports and I see all of the numbers as an ember service subclass.

How do I get my numbers from the service, through the controller into the html template?




Aucun commentaire:

Enregistrer un commentaire