Skip to content

Commit 8bc38ae

Browse files
committed
refactor(material/progress-bar): convert to standalone
Converts `material/progress-bar` to standalone.
1 parent 367f868 commit 8bc38ae

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

src/material/progress-bar/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {MatCommonModule} from '@angular/material/core';
1111
import {MatProgressBar} from './progress-bar';
1212

1313
@NgModule({
14+
imports: [MatProgressBar],
1415
exports: [MatProgressBar, MatCommonModule],
15-
declarations: [MatProgressBar],
1616
})
1717
export class MatProgressBarModule {}

src/material/progress-bar/progress-bar.spec.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {TestBed, ComponentFixture} from '@angular/core/testing';
22
import {ApplicationRef, Component, DebugElement, Provider, Type} from '@angular/core';
33
import {By} from '@angular/platform-browser';
4-
import {dispatchFakeEvent} from '../../cdk/testing/private';
4+
import {dispatchFakeEvent} from '@angular/cdk/testing/private';
55
import {MatProgressBarModule, MAT_PROGRESS_BAR_DEFAULT_OPTIONS} from './index';
66
import {MatProgressBar} from './progress-bar';
77

@@ -11,8 +11,7 @@ describe('MDC-based MatProgressBar', () => {
1111
providers: Provider[] = [],
1212
): ComponentFixture<T> {
1313
TestBed.configureTestingModule({
14-
imports: [MatProgressBarModule],
15-
declarations: [componentType],
14+
imports: [MatProgressBarModule, componentType],
1615
providers,
1716
}).compileComponents();
1817

@@ -329,8 +328,16 @@ describe('MDC-based MatProgressBar', () => {
329328
});
330329
});
331330

332-
@Component({template: '<mat-progress-bar></mat-progress-bar>'})
331+
@Component({
332+
template: '<mat-progress-bar></mat-progress-bar>',
333+
standalone: true,
334+
imports: [MatProgressBar],
335+
})
333336
class BasicProgressBar {}
334337

335-
@Component({template: '<mat-progress-bar mode="buffer"></mat-progress-bar>'})
338+
@Component({
339+
template: '<mat-progress-bar mode="buffer"></mat-progress-bar>',
340+
standalone: true,
341+
imports: [MatProgressBar],
342+
})
336343
class BufferProgressBar {}

src/material/progress-bar/progress-bar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export type ProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'quer
101101
styleUrls: ['progress-bar.css'],
102102
changeDetection: ChangeDetectionStrategy.OnPush,
103103
encapsulation: ViewEncapsulation.None,
104+
standalone: true,
104105
})
105106
export class MatProgressBar implements AfterViewInit, OnDestroy {
106107
constructor(

src/material/progress-bar/testing/progress-bar-harness.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ describe('MatProgressBarHarness', () => {
1111

1212
beforeEach(async () => {
1313
await TestBed.configureTestingModule({
14-
imports: [MatProgressBarModule],
15-
declarations: [ProgressBarHarnessTest],
14+
imports: [MatProgressBarModule, ProgressBarHarnessTest],
1615
}).compileComponents();
1716

1817
fixture = TestBed.createComponent(ProgressBarHarnessTest);
@@ -45,6 +44,8 @@ describe('MatProgressBarHarness', () => {
4544
<mat-progress-bar mode="determinate" [value]="value"></mat-progress-bar>
4645
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
4746
`,
47+
standalone: true,
48+
imports: [MatProgressBarModule],
4849
})
4950
class ProgressBarHarnessTest {
5051
value: number;

tools/public_api_guard/material/progress-bar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class MatProgressBar implements AfterViewInit, OnDestroy {
5353
get value(): number;
5454
set value(v: number);
5555
// (undocumented)
56-
static ɵcmp: i0.ɵɵComponentDeclaration<MatProgressBar, "mat-progress-bar", ["matProgressBar"], { "color": { "alias": "color"; "required": false; }; "value": { "alias": "value"; "required": false; }; "bufferValue": { "alias": "bufferValue"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; }, { "animationEnd": "animationEnd"; }, never, never, false, never>;
56+
static ɵcmp: i0.ɵɵComponentDeclaration<MatProgressBar, "mat-progress-bar", ["matProgressBar"], { "color": { "alias": "color"; "required": false; }; "value": { "alias": "value"; "required": false; }; "bufferValue": { "alias": "bufferValue"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; }, { "animationEnd": "animationEnd"; }, never, never, true, never>;
5757
// (undocumented)
5858
static ɵfac: i0.ɵɵFactoryDeclaration<MatProgressBar, [null, null, null, { optional: true; }, { optional: true; }]>;
5959
}
@@ -77,7 +77,7 @@ export class MatProgressBarModule {
7777
// (undocumented)
7878
static ɵinj: i0.ɵɵInjectorDeclaration<MatProgressBarModule>;
7979
// (undocumented)
80-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatProgressBarModule, [typeof i1.MatProgressBar], never, [typeof i1.MatProgressBar, typeof i2.MatCommonModule]>;
80+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatProgressBarModule, never, [typeof i1.MatProgressBar], [typeof i1.MatProgressBar, typeof i2.MatCommonModule]>;
8181
}
8282

8383
// @public

0 commit comments

Comments
 (0)