无法将变量值发送到函数中

时间:2018-03-20 11:09:12

标签: html angular drop-down-menu

        <li ngbDropdown="" class="nav-item dropdown">
          <a ngbDropdownToggle="" class="nav-link dropdown-toggle" href="javascript:;" id="bydate" data-toggle="dropdown" aria-haspopup="true"
            aria-expanded="false">
          <i class="icofont icofont-bank-alt"></i> All</a>
          <div ngbDropdownMenu class="dropdown-menu" aria-labelledby="bydate">
            <a class="dropdown-item" value="all" (click)="setCategory('all')">All</a>
            <div *ngFor="let category of categories">
            <a class="dropdown-item" [ngClass]="category.selected"  value="category" (click)="setCategory(catergory);">{{category}}</a>
          </div>
          </div>
        </li>

我正在尝试发送一个类别的值,将下拉值更改为setCategory()函数,但我得到的值为undefined。

0 个答案:

没有答案