0

I have below angular snippet. It uses BSDropdownModule from 'ngx-bootstrap/dropdown'. Now I want to add condition based on which the dropdown should be visible. in below code I want to add it at 'ul' level. But *ngIf in 'ul' gives error. I tried search and finding document for this but didn't found any. Your help or reference to documents is highly appreciated.

<div class="btn-group" dropdown>
  <button dropdownToggle type="button" class="btn btn-primary dropdown-toggle">
    Button dropdown <span class="caret"></span>
  </button>
  <ul *dropdownMenu class="dropdown-menu" role="menu">
    <li role="menuitem"><a class="dropdown-item" href="#">Action</a></li>
    <li role="menuitem"><a class="dropdown-item" href="#">Another action</a></li>
    <li role="menuitem"><a class="dropdown-item" href="#">Something else here</a></li>
    <li class="divider dropdown-divider"></li>
    <li role="menuitem"><a class="dropdown-item" href="#">Separated link</a>
    </li>
  </ul>
Purohit Hitesh
  • 1,018
  • 16
  • 28

0 Answers0