Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
303 views
in Technique[技术] by (71.8m points)

How to get selected item from element within mdbootstrap's dropdown component in Angular 10?

I'm using mdbootstrp dropdown component I managed to fill it up with some objects from API but I cannot get it to extract data:

   <div class="container">
    
      <div class="row">
    
        <div class="col-lg-4 d-flex justify-content-center col-md-auto my-5">
          <div class="dropdown" mdbDropdown>
    
            <button mdbDropdownToggle mdbBtn color="primary" class="dropdown-toggle waves-light" type="button"
              mdbWavesEffect>
              Choose item
            </button>
          
            <div class="dropdown-menu dropdown-primary"> 
              <a class="dropdown-item" *ngFor="let item of items" href="#" > {{item.name}} </a> 
            </div> 
    
    
          </div>
    
        </div>
       </div>

I've tried so many things, sorry If I'm not placing here what I've tried. Is there any way to extract selected value from this dropdown?

question from:https://stackoverflow.com/questions/65648148/how-to-get-selected-item-from-element-within-mdbootstraps-dropdown-component-in

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...