如何显示从引导模式到主按钮的选定按钮值

时间:2019-07-01 08:00:34

标签: html

因此,我正在使用引导程序模态来显示我的按钮列表,但是出于某些目的,我没有使用select方法,我只是以模态显示我的按钮列表。我想在主按钮中显示以模态形式按下的按钮的值。

这是我的按钮,按下该按钮会打开一个引导程序模式:

<button type="button" class="btn btn-primary btn-lg form-control" 
   id="fSum" data-toggle="modal" data-target="#exampleModalScrollable"> 

   NEEDED VALUE TO BE DISPLAYED 
   <span class="badge badge-light float-right">V</span>
</button>

这是我的模态:

<div class="modal" id="exampleModalScrollable" tabindex="-1" role="dialog" aria-labelledby="exampleModalScrollableTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable" role="document">
    <div class="modal-content">

      <div class="modal-header">
         <h5 class="modal-title" id="exampleModalScrollableTitle">Choose:</h5>
         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
           <span aria-hidden="true">&times;</span>
         </button>
      </div>

      <div class="modal-body">
        <div class="btn-group-vertical w-100" role="group">
           <button type="button" class="btn btn-outline-secondary" data-dismiss="modal" *ngFor="let item of product" (click)="postSum()">
              {{item.amount}}
           </button>
          <br>
          <br>
        </div>
      </div>
    </div>
  </div>
</div>

注释:{{item.amount}}是一个数组,可以在模式中创建按钮列表

0 个答案:

没有答案
相关问题