Khalil Ghâñmî

0 %
Khalil Ghâñmî
Développeur full-stack
  • Residence:
    Tunis
  • City:
    Bardo
  • Age:
    30
French
English
arabe
HTML 5 / CSS 3
JavaScript / jquery
PHP / MYSQL
WordPress
OpenCart 3
Vegas Pro
Adobe premier pro
  • Bootstrap, Materialize
  • Stylus, Sass, Less

collapse angular bootstrap

18 April 2023

oggle the visibility of content across your project with a few classes and our JavaScript plugins.

Example

Click the buttons below to show and hide another element via class changes:

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

code

collapse-basic.html

<p>
	<button
		type="button"
		class="btn btn-outline-primary"
		(click)="collapse.toggle()"
		[attr.aria-expanded]="!isCollapsed"
		aria-controls="collapseExample"
	>
		Toggle with Function
	</button>
	<button
		type="button"
		class="btn btn-outline-primary ms-2"
		(click)="isCollapsed = ! isCollapsed"
		[attr.aria-expanded]="!isCollapsed"
		aria-controls="collapseExample"
	>
		Toggle with Two Way Binding
	</button>
</p>
<div #collapse="ngbCollapse" [(ngbCollapse)]="isCollapsed">
	<div class="card">
		<div class="card-body">You can collapse this card by clicking one Toggle button</div>
	</div>
</div>

collapse-basic.ts

import { Component } from '@angular/core';
import { NgbCollapseModule } from '@ng-bootstrap/ng-bootstrap';

@Component({
	selector: 'ngbd-collapse-basic',
	standalone: true,
	imports: [NgbCollapseModule],
	templateUrl: './collapse-basic.html',
})
export class NgbdCollapseBasic {
	public isCollapsed = false;
}
Posted in angular, angular, WebTags:
Write a comment