lundi 20 avril 2020

How can I search the name or the email using ember-power-select

I am using an addon called ember-power-select.

Github: https://github.com/cibernox/ember-power-select

Docs for search: https://ember-power-select.com/docs/the-search

Docs for Multiple select: https://ember-power-select.com/docs/multiple-selection/

Question: How can I search using name or email

/template.hbs

<PowerSelectMultiple
  @searchEnabled=true
  @options=
  @selected=
  @searchField="email"
  @placeholder="Select some names..."
  @onChange= as |author|>
  
</PowerSelectMultiple>

/controller.js

 authors = [
    { name: 'Foo', email: 'foo@gmail.com' },
    { name: 'Bar', email: 'bar@gmail.com'},
    { name: 'Baz' email:  'baz@gmai.com'}
  ]



Aucun commentaire:

Enregistrer un commentaire