import { Component, Input, ContentChild, Output, EventEmitter } from '@angular/core'; import { SectionHeaderComponent } from './section-header.component'; import './section.scss'; @Component({ selector: 'swui-section', template: `

`, host: { class: 'swui-section' } }) export class SectionComponent { @Input() sectionCollapsed: boolean = false; @Input() sectionCollapsible: boolean = true; @Input() sectionTitle: string; @Output() toggle = new EventEmitter(); @ContentChild(SectionHeaderComponent) headerComp: SectionHeaderComponent; onSectionClicked() { this.sectionCollapsed = !this.sectionCollapsed; this.toggle.emit(this.sectionCollapsed); } }