File

src/accordion/accordion.component.ts

Description

See demo

../../iframe.html?id=accordion--basic

Implements

AfterContentInit

Metadata

selector ibm-accordion
template
<ul class="bx--accordion">
	<ng-content></ng-content>
</ul>
	

Index

Properties
Methods
Inputs
Accessors

Inputs

skeleton

Type : any

Methods

ngAfterContentInit
ngAfterContentInit()
Returns : void
Protected updateChildren
updateChildren()
Returns : void

Properties

Protected _skeleton
_skeleton:
Default value : false
children
children: QueryList<AccordionItem>
Type : QueryList<AccordionItem>
Decorators :
@ContentChildren(AccordionItem)

Accessors

skeleton
getskeleton()
setskeleton(value: any)
Parameters :
Name Type Optional
value any No
Returns : void
import {
	Component,
	Input,
	ContentChildren,
	QueryList,
	AfterContentInit
} from "@angular/core";
import { AccordionItem } from "./accordion-item.component";

/**
 * [See demo](../../?path=/story/accordion--basic)
 *
 * <example-url>../../iframe.html?id=accordion--basic</example-url>
 */
@Component({
	selector: "ibm-accordion",
	template: `
		<ul class="bx--accordion">
			<ng-content></ng-content>
		</ul>
	`
})
export class Accordion implements AfterContentInit {
	@ContentChildren(AccordionItem) children: QueryList<AccordionItem>;

	protected _skeleton = false;

	@Input()
	set skeleton(value: any) {
		this._skeleton = value;
		this.updateChildren();
	}

	get skeleton(): any {
		return this._skeleton;
	}

	ngAfterContentInit() {
		this.updateChildren();
	}

	protected updateChildren() {
		if (this.children) {
			this.children.toArray().forEach(child => child.skeleton = this.skeleton);
		}
	}
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""