bootstrap 4 navbar doesn't collapse code example

Example 1: bootstrap 4 navbar-collapse not working angular

<button class="navbar-toggler" type="button" (click)="navbarCollapsed = !navbarCollapsed" [attr.aria-expanded]="!navbarCollapsed" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
</button>

Example 2: bootstrap 4 navbar-collapse not working angular

<div class="collapse navbar-collapse" [ngbCollapse]="navbarCollapsed" id="navbarSupportedContent">

Tags:

Misc Example