Collapse all on items by default ng-bootstrap

独自空忆成欢 提交于 2019-12-11 17:58:37

问题


Have 2 things here: Entity management and company.

Currently when i click on entity management, company will be hidden. But what i want is company to be collapsed by default.

Then when i click on entity management, it will show.

  <li> <a (click)="isCollapsed=!isCollapsed" aria-controls="collapseExample"><i class="icon-interface-windows"></i>Entity Management</a></li>
  <div id="collapseExample" [ngbCollapse]="isCollapsed">
    <li><a routerLink="/job"> <i class="icon-interface-windows"></i>Company</a></li>
  </div>

Referencing to: https://ng-bootstrap.github.io/#/components/collapse/examples


回答1:


In your ts file add

isCollapsed = true;


来源:https://stackoverflow.com/questions/57922586/collapse-all-on-items-by-default-ng-bootstrap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!