UNPKG

ng-metamagic-extensions

Version:

[![npm version](https://badge.fury.io/js/ng-metamagic-extensions.svg)](https://badge.fury.io/js/ng-metamagic-extensions) [![TeamCity CodeBetter](https://img.shields.io/teamcity/codebetter/bt428.svg)]() [![NPM](https://nodei.co/npm/ng-metamagic-extension

31 lines (21 loc) 562 B
import {Component, ContentChild, Input, OnInit} from '@angular/core'; @Component({ selector: 'tab', template: ` <div role="tabpanel" class="tab-pane active" [attr.id]="elementId"> <ng-content *ngIf="active"></ng-content> </div> ` }) export class TabComponent implements OnInit { @Input() title: string; @Input() active = false; @Input() disabled = false; @Input() icon : string; elementId : string; constructor() { this.elementId = 'tab-pill'+Math.floor(Math.random() * 90000) + 10000;; } ngOnInit() { } }