Topic: doubts about select and dropdown operation

yeisonvelez11 free asked 6 years ago


I have seen the documentation for the dropdown. I have several questions about it:

1- Is it necessary to use this structure?

{ value: '1', label: 'Option 1' }, { value: '2', label: 'Option 2' }, { value: '3', label: 'Option 3' },
 
or I can simply include something like this:

<option * ngFor = "let item of aClient" [value] = "item.id"> {{item.name}} </ option>

2- from the component, how can I get the current value of the dropdown?

in this documentation:

https://mdbootstrap.com/docs/angular/components/dropdowns/

3- How can I obtain, set and detect the change of some dropdown option?

4- Is there something to write and autocomplete some element of the dropdown
thanks
 

Damian Gemza staff answered 5 years ago


Dear @yeisonvelez11 

Let me answer your question in order in which you have asked them:

1. There's no possibility to use another scheme for constructing data for Material Select than {value: '', label: ''} object.

2. Please check our Select Documentation. There's described, how to get selected value.

3. There's no built-in feature for this behavior. You have to write your own feature, like observable or something similar.

4. For now, there's no such possibility.

Best Regards,

Damian



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.0.0
  • Device: web
  • Browser: chrome
  • OS: windows 10
  • Provided sample code: Yes
  • Provided link: No