Skip to content

Commit dbd5817

Browse files
committed
Set initial value for spinner to 0.
1 parent 520d83b commit dbd5817

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/progress-spinner/progress-spinner.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {By} from '@angular/platform-browser';
44
import {MatProgressSpinnerModule} from './index';
55

66

7-
describe('MatProgressSpinner', () => {
7+
fdescribe('MatProgressSpinner', () => {
88

99
beforeEach(async(() => {
1010
TestBed.configureTestingModule({
@@ -37,12 +37,12 @@ describe('MatProgressSpinner', () => {
3737
expect(progressElement.componentInstance.mode).toBe('indeterminate');
3838
});
3939

40-
it('should define a default value of undefined for the value attribute', () => {
40+
it('should define a default value of zero for the value attribute', () => {
4141
let fixture = TestBed.createComponent(BasicProgressSpinner);
4242
fixture.detectChanges();
4343

4444
let progressElement = fixture.debugElement.query(By.css('mat-progress-spinner'));
45-
expect(progressElement.componentInstance.value).toBeUndefined();
45+
expect(progressElement.componentInstance.value).toBe(0);
4646
});
4747

4848
it('should set the value to 0 when the mode is set to indeterminate', () => {

src/lib/progress-spinner/progress-spinner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const INDETERMINATE_ANIMATION_TEMPLATE = `
8383
export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements CanColor,
8484
OnChanges {
8585

86-
private _value: number;
86+
private _value: number = 0;
8787
private readonly _baseSize = 100;
8888
private readonly _baseStrokeWidth = 10;
8989
private _fallbackAnimation = false;
@@ -116,7 +116,7 @@ export class MatProgressSpinner extends _MatProgressSpinnerMixinBase implements
116116

117117
/** Value of the progress circle. */
118118
@Input()
119-
get value() {
119+
get value(): number {
120120
return this.mode === 'determinate' ? this._value : 0;
121121
}
122122
set value(newValue: number) {

0 commit comments

Comments
 (0)