pm-controls
Version:
ProModel Controls
29 lines (25 loc) • 764 B
text/typescript
import { NgModule, Component,
EventEmitter, Output } from '@angular/core';
import { RadioTabComponent } from '../radio/radio-tab-component';
({
selector: 'pm-radio-tabs',
//templateUrl: './app/controls/components/radio/radio-tabs.html',
templateUrl: './radio-tabs.html'
})
export class RadioTabsComponent {
tabs:RadioTabComponent[] = [ ];
() selected = new EventEmitter();
addTab(tab: RadioTabComponent) {
if (this.tabs.length === 0) {
tab.selected = true;
}
this.tabs.push(tab);
}
selectTab(tab: RadioTabComponent) {
this.tabs.map((tab) => {
tab.selected = false;
})
tab.selected = true;
this.selected.emit({selectedTab: tab});
}
}