Skip to content

Commit c9f11c2

Browse files
committed
refactor(circular progress): remove unnecessary methods
1 parent 47de23f commit c9f11c2

File tree

3 files changed

+4
-42
lines changed

3 files changed

+4
-42
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<igx-circular-bar
2-
[max]="100"
2+
[value]="100"
33
[animate]="true"
44
class="custom-size"
55
></igx-circular-bar>
Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
1-
import { Component, OnInit, ViewChild, ViewEncapsulation } from "@angular/core";
2-
import { IgxCircularProgressBarComponent } from "igniteui-angular";
1+
import { Component } from "@angular/core";
32

43
@Component({
5-
encapsulation: ViewEncapsulation.None,
64
selector: "app-circular-progressbar",
75
styleUrls: ["./circular-progressbar.component.scss"],
86
templateUrl: "./circular-progressbar.component.html"
97
})
10-
export class CircularProgressbarComponent implements OnInit {
11-
12-
public interval: any;
13-
14-
@ViewChild(IgxCircularProgressBarComponent, { static: true }) public circularBar: IgxCircularProgressBarComponent;
15-
16-
public ngOnInit() {
17-
this.interval = setInterval(this.updateValue.bind(this), 60);
18-
}
19-
20-
public updateValue() {
21-
this.circularBar.value += 1;
22-
if (this.circularBar.value === this.circularBar.max) {
23-
this.interval = clearInterval(this.interval);
24-
}
25-
}
26-
}
8+
export class CircularProgressbarComponent { }

src/app/data-display/circular-progressbar/circular-styling-sample/circular-styling-sample.component.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,4 @@ import { Component } from "@angular/core";
55
styleUrls: ["./circular-styling-sample.component.scss"],
66
templateUrl: "./circular-styling-sample.component.html"
77
})
8-
export class CircularStylingSampleComponent {
9-
public currentValue: number;
10-
11-
public ngOnInit() {
12-
this.currentValue = 0;
13-
}
14-
15-
public addProgress() {
16-
this.currentValue += 10;
17-
if (this.currentValue > 100) {
18-
this.currentValue = 100;
19-
}
20-
}
21-
22-
public removeProgress() {
23-
this.currentValue -= 10;
24-
if (this.currentValue < 0) {
25-
this.currentValue = 0;
26-
}
27-
}
28-
}
8+
export class CircularStylingSampleComponent { }

0 commit comments

Comments
 (0)