Skip to content

Commit

Permalink
style: use shared tslint config and prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Dec 23, 2017
1 parent 371f770 commit 335d1cb
Show file tree
Hide file tree
Showing 6 changed files with 552 additions and 85 deletions.
4 changes: 4 additions & 0 deletions .prettierrc
@@ -0,0 +1,4 @@
{
"parser": "typescript",
"singleQuote": true
}
18 changes: 8 additions & 10 deletions demo/demo.component.ts
Expand Up @@ -70,7 +70,8 @@ import { Component, ViewEncapsulation, OnInit, OnDestroy } from '@angular/core';
</div>
`,
styles: [`
styles: [
`
body {
background-color: rgba(0,0,0,0.8);
color: #999;
Expand Down Expand Up @@ -182,10 +183,10 @@ import { Component, ViewEncapsulation, OnInit, OnDestroy } from '@angular/core';
fill: #FF6DAF;
font-size: 7em;
}
`]
`
]
})
export class DemoComponent implements OnInit, OnDestroy {

percentageValue: (value: number) => string;

gaugeValues: any = {
Expand All @@ -197,18 +198,17 @@ export class DemoComponent implements OnInit, OnDestroy {
6: 50
};

interval: number;
interval: any;

constructor() {
this.percentageValue = function(value: number): string {
return `${Math.round(value)} / ${this.max}`;
return `${Math.round(value)} / ${this['max']}`;
};
}

ngOnInit(): void {

const updateValues: Function = (): void => {
this.gaugeValues = {
const updateValues = (): void => {
this.gaugeValues = {
1: Math.round(Math.random() * 100),
2: Math.round(Math.random() * 100),
3: Math.round(Math.random() * 100),
Expand All @@ -222,11 +222,9 @@ export class DemoComponent implements OnInit, OnDestroy {

this.interval = setInterval(updateValues, INTERVAL);
updateValues();

}

ngOnDestroy(): void {
clearInterval(this.interval);
}

}

0 comments on commit 335d1cb

Please sign in to comment.