Hi i have a controller with a drop down which needs location data. I provide this data via a service. The service is working find I know it as dropLocation: alias('loaddropLocation')
line works and show all the location with duplicates. But when i change the alias
to uniq
i expect to get unique array data. but it does not work.
import Ember from 'ember';
const {
get,
computed,
}= Ember;
const{
uniq,
alias
} = computed;
const {
service,
} = Ember.inject;
export default Ember.Controller.extend({
dropLocation: uniq('loaddropLocation'),//first-line
Dropdata: service(),
loaddropLocation: computed('Dropdata',function(){
return get(this,'Dropdata').locations().then((locs) =>{
return locs;
});
}),
})
Aucun commentaire:
Enregistrer un commentaire