This repository was archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathstop-watch.ts
More file actions
46 lines (45 loc) · 1.29 KB
/
stop-watch.ts
File metadata and controls
46 lines (45 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import {Component, Input, Output, EventEmitter, ViewEncapsulation, ChangeDetectionStrategy} from '@angular/core'
@Component({
selector: 'stop-watch',
template: `
<div class="watch">
<div class="unit">{{hours}}</div>
<div class="sep"> : </div>
<div class="unit">{{minutes}}</div>
<div class="sep"> : </div>
<div class="unit">{{seconds}}</div>
<div class="sep"> : </div>
<div class="unit">{{milliseconds}}</div>
</div>
`,
encapsulation: ViewEncapsulation.Native,
changeDetection: ChangeDetectionStrategy.OnPush,
styles: [
`:host {
background: #2196F3;
padding: 20px;
display: block;
font-family: monospace;
box-shadow: 0 16px 16px 0 rgba(0,0,0,0.1);
}`,
`
:host .watch{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-evenly;
}`,
`
:host .watch .unit, :host .watch .sep{
font-size: 32px;
color: #FFEB3B;
}
`
]
})
export class StopWatch {
@Input() hours: string;
@Input() minutes: string;
@Input() seconds: string;
@Input() milliseconds: string;
}