Skip to content

Commit 2c0d003

Browse files
committed
set up MDC foundation for MDC-based MatProgressSpinner
1 parent 2af4c81 commit 2c0d003

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/material-experimental/config.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ entryPoints = [
1717
"mdc-menu/testing",
1818
"mdc-progress-bar",
1919
"mdc-progress-bar/testing",
20+
"mdc-progress-spinner",
21+
"mdc-progress-spinner/testing",
2022
"mdc-radio",
2123
"mdc-select",
2224
"mdc-sidenav",

src/material-experimental/mdc-progress-spinner/progress-spinner.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core';
9+
import {
10+
AfterViewInit,
11+
ChangeDetectionStrategy,
12+
Component,
13+
OnDestroy,
14+
ViewEncapsulation
15+
} from '@angular/core';
16+
import {MDCCircularProgressFoundation} from '@material/circular-progress'
1017

1118
@Component({
1219
selector: 'mat-progress-spinner',
@@ -16,4 +23,18 @@ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/co
1623
changeDetection: ChangeDetectionStrategy.OnPush,
1724
encapsulation: ViewEncapsulation.None,
1825
})
19-
export class MatProgressSpinner {}
26+
export class MatProgressSpinner implements AfterViewInit, OnDestroy{
27+
private _circularProgressFoundation: MDCCircularProgressFoundation;
28+
29+
constructor() {
30+
this._circularProgressFoundation = new MDCCircularProgressFoundation();
31+
}
32+
33+
ngAfterViewInit() {
34+
this._circularProgressFoundation.init();
35+
}
36+
37+
ngOnDestroy() {
38+
this._circularProgressFoundation.destroy();
39+
}
40+
}

0 commit comments

Comments
 (0)