select means: choose 1 from N

Tags:


{
  "label": "B",
  "id": "b",
  "items": [
    {
      "label": "B1",
      "id": "b1"
    },
    {
      "label": "B2",
      "id": "b2"
    }
  ]
}
No documentation yet

Authors:Zhicheng Wang

<div class="dropdown-menu static">
  <a *ngFor="let option of options" (click)="select.select(option)" [class.active]="select.selected(option)"
    class="dropdown-item">
    {{option.label}}
  </a>
</div>

<hr>

<ul class="nav nav-pills">
  <li *ngFor="let option of options; let last=last" class="nav-item" [class.float-sm-right]="last">
    <a class="nav-link" uiPreventDefault href [class.active]="select.selected(option)"
      (mouseenter)="select.select(option)">{{option.label}}</a>
    <div *ngIf="select.selected(option)" class="dropdown-menu">
      <a *ngFor="let item of option.items" class="dropdown-item" [class.active]="subMenu.selected(item)"
        (mouseenter)="subMenu.select(item)">
        {{item.label}}
      </a>
    </div>
  </li>
</ul>

<app-json-viewer [value]="select.selection"></app-json-viewer>