Skip to content

Instantly share code, notes, and snippets.

@pankajparkar
Created April 1, 2019 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pankajparkar/1f453eb2e458e97262fbba5f9f5741a0 to your computer and use it in GitHub Desktop.
Save pankajparkar/1f453eb2e458e97262fbba5f9f5741a0 to your computer and use it in GitHub Desktop.
import { Component, OnInit, Input, Host } from '@angular/core';
import { TabsComponent } from '../tabs/tabs.component'
@Component({
selector: 'tab',
template: `
<div class="tab-pane" *ngIf="details.selected">
<h4>{{details.title}}</h4>
<ng-content></ng-content>
</div>
`,
styleUrls: ['./tab.component.css']
})
export class TabComponent implements OnInit {
@Input() details;
constructor(@Host() private tabsCtrl: TabsComponent) { }
ngOnInit() {
this.tabsCtrl.addPane(this.details);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment