app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
isCollapsed:boolean = false;
}
app.component.html
<h4 style="padding-top:25px; padding-bottom:25px;">
Angular Bootstrap - How to use Collapse
</h4>
<p>
<button
type="button"
class="btn btn-outline-primary"
(click)="collapse.toggle()"
[attr.aria-expanded]="!isCollapsed"
aria-controls="collapseExample">
Toggle Collapse
</button>
</p>
<div #collapse="ngbCollapse" [(ngbCollapse)]="isCollapsed">
<div class="card">
<div class="card-body">
We can collapse this card by clicking the Toggle button.
</div>
</div>
</div>
- angular - How to toggle element visibility
- angular bootstrap - How to show an alert
- angular bootstrap - How to use Rating
- angular bootstrap - Rating hover event
- angular bootstrap - Readonly & editable Rating
- angular bootstrap - How to show Toast message
- angular bootstrap - Progressbar maximum value
- angular bootstrap - How to show striped Progressbar
- angular bootstrap - Light & dark Progressbar
- angular bootstrap - How to use Popover
- angular bootstrap - Open Popover on mouse hover
- angular bootstrap - Open close Popover on button click
- angular bootstrap - Popover manual triggers
- angular bootstrap - Popover custom CSS class
- angular bootstrap - Popover shown & hidden event