Basic popover tab components.

This commit is contained in:
József Farkas
2016-05-12 19:50:24 +02:00
parent da44928169
commit ac5bf13105
8 changed files with 158 additions and 11 deletions

View File

@@ -0,0 +1,47 @@
import { Component, OnInit } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'capture-keystroke-button',
template:
`
<button type="button" class="btn btn-sm btn--capture-keystroke"
[ngClass]="{'btn-default': !record, 'btn-info': record}"
(click)="record ? stop() : start()">
<i class="fa" [ngClass]=" { 'fa-circle' : !record, 'fa-square': record }"></i>
<template [ngIf]="!record">
Capture keystroke
</template>
<template [ngIf]="record">
Stop capturing
</template>
</button>
`,
styles:
[`
button {
display: inline-block;
margin: 0 0 0 .25rem;
}
.fa-circle {
color:#c00;
}
`]
})
export class CaptureKeystrokeButtonComponent implements OnInit {
private record: boolean;
constructor() { }
ngOnInit() { }
private start(): void {
this.record = true;
}
private stop(): void {
this.record = false;
}
}