Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4838

Ember services for the fetch data

$
0
0

@Vishwajit_Kolekar wrote:

I am using ember ( v 3.0) service to fetch customer data . when i am calling same service from template , it not showing any data . following are the code

//service.js
export default Service.extend({
  store: Ember.inject.service(),
  cutomers : null,

  getProperty() {
     var list = this.get('store').findAll('customer');
     this.set('cutomer', list );
     return this.get('cutomers');
   }
});
//controller.js 
export default Controller.extend({
    customerList: Ember.inject.service('customers-list'),
});
{{! template.js }}
<select ui-jq="chosen" class="w-full">
   {{#each customersList.cutomers as |item|}}
      <option value={{item.id}}> {{item.name}} </option>
   {{/each}}
</select>

Posts: 5

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles