angular2-simple-ui
Version:
Angular 2 Simple Material Design UI Components customisable with Simple 30 KB CSS with LESS support and full features support , just plugin up and run for clarity look at sample examples
40 lines (34 loc) • 1.01 kB
text/typescript
import { AccordionGroupComponent } from './sui.accordion.group.component';
import {
ContentChildren,
Component,
QueryList,
Input,
forwardRef,
AfterContentInit
} from '@angular/core';
export class AccordionComponent implements AfterContentInit {
accordionClass: string;
accordionStyle: Object = {};
closeOthers = true;
expandAll = false;
groups: QueryList<AccordionGroupComponent>;
ngAfterContentInit() {
if (this.expandAll) {
this.closeOthers = false;
this.groups.toArray().forEach(group => {
group.isOpened = true;
});
}
}
closeAll() {
this.groups.toArray().forEach(group => {
group.isOpened = false;
});
}
}