mardi 12 septembre 2017

How to pass a function in selected from ember-power-select

I have an Ember.js application, and for a form in it, I am using ember-power-select. I already used that addon, but I have some problems with how to configure the selected element. As the title say, I am asking for help with how to configure the selected with a function.
I want to set the selected variable with a function that retrieve a variable from a services.

My component look like that:

import Ember from 'ember';

export default Ember.Component.
    authSrv: Ember.inject.service('authentication'),

leosacInfo: Ember.inject.service('leosac-info'), store: Ember.inject.service(), _title: 'settings', /** * onLogout action name. */ onLogout: 'onLogout', languageOption: ['Français', 'English'], language() { console.log(this.get('leosacInfo').getLocale()); return "ENGLISH"; } });




Aucun commentaire:

Enregistrer un commentaire