/**
* The main component that renders single TabComponent
* instances.
*/
import {
Component,
ContentChildren,
QueryList,
AfterContentInit, Output, EventEmitter,
} from '@angular/core';
import { TabComponent } from './tab.component';
@Component({
selector: 'my-tabs',
template: `
2 ? 'uk-visible@m' : '') + ' uk-tab main-tabs uk-margin-remove uk-child-width-expand'"
uk-tab uk-switcher="connect: .tabs-content" uk-height-match="target: .tab-header">
-
{{tab.num | number}}
2 ? 'uk-visible@m' : '') + ' uk-switcher tabs-content main-tabs-content'">
`
})
export class TabsComponent {
@ContentChildren(TabComponent) tabs: QueryList;
@Output() public selectedActiveTab: EventEmitter = new EventEmitter();
selectTab(tab: TabComponent){
// activate the tab the user has clicked on.
this.selectedActiveTab.emit(tab.tabId);
}
}