src/accordion/accordion.component.ts
selector | ibm-accordion |
template |
|
Properties |
Methods |
|
Inputs |
Accessors |
skeleton
|
Type : |
Defined in src/accordion/accordion.component.ts:29
|
ngAfterContentInit |
ngAfterContentInit()
|
Defined in src/accordion/accordion.component.ts:38
|
Returns :
void
|
Protected updateChildren |
updateChildren()
|
Defined in src/accordion/accordion.component.ts:42
|
Returns :
void
|
Protected _skeleton |
_skeleton:
|
Default value : false
|
Defined in src/accordion/accordion.component.ts:26
|
children |
children:
|
Type : QueryList<AccordionItem>
|
Decorators :
@ContentChildren(AccordionItem)
|
Defined in src/accordion/accordion.component.ts:24
|
skeleton | ||||||
getskeleton()
|
||||||
Defined in src/accordion/accordion.component.ts:34
|
||||||
setskeleton(value: any)
|
||||||
Defined in src/accordion/accordion.component.ts:29
|
||||||
Parameters :
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);
}
}
}