Skip to content

Commit d84703a

Browse files
crisbetoandrewseguin
authored andcommitted
build: switch dev app to standalone components
Switches the dev app components to the new standalone components API which saves us a bunch of boilerplate.
1 parent 067a094 commit d84703a

File tree

240 files changed

+1192
-2702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+1192
-2702
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"@angular-devkit/build-angular": "14.0.0-next.12",
7272
"@angular-devkit/core": "14.0.0-next.12",
7373
"@angular-devkit/schematics": "14.0.0-next.12",
74-
"@angular/bazel": "14.0.0-next.15",
74+
"@angular/bazel": "14.0.0-next.14",
7575
"@angular/cli": "14.0.0-next.12",
7676
"@angular/compiler-cli": "14.0.0-next.15",
7777
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#335aad1b04b3d95cd4cb1d719e73b93d4e90cce3",

src/dev-app/autocomplete/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ ng_module(
1616
"//src/material/form-field",
1717
"//src/material/input",
1818
"@npm//@angular/forms",
19-
"@npm//@angular/router",
2019
],
2120
)
2221

src/dev-app/autocomplete/autocomplete-demo-module.ts

-34
This file was deleted.

src/dev-app/autocomplete/autocomplete-demo.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
*/
88

99
import {Component, ViewChild} from '@angular/core';
10-
import {FormControl, NgModel} from '@angular/forms';
10+
import {CommonModule} from '@angular/common';
11+
import {FormControl, FormsModule, NgModel, ReactiveFormsModule} from '@angular/forms';
12+
import {MatAutocompleteModule} from '@angular/material/autocomplete';
13+
import {MatButtonModule} from '@angular/material/button';
14+
import {MatCardModule} from '@angular/material/card';
15+
import {MatFormFieldModule} from '@angular/material/form-field';
16+
import {MatInputModule} from '@angular/material/input';
1117
import {Observable} from 'rxjs';
1218
import {map, startWith} from 'rxjs/operators';
1319

@@ -25,6 +31,17 @@ export interface StateGroup {
2531
selector: 'autocomplete-demo',
2632
templateUrl: 'autocomplete-demo.html',
2733
styleUrls: ['autocomplete-demo.css'],
34+
standalone: true,
35+
imports: [
36+
CommonModule,
37+
FormsModule,
38+
MatAutocompleteModule,
39+
MatButtonModule,
40+
MatCardModule,
41+
MatFormFieldModule,
42+
MatInputModule,
43+
ReactiveFormsModule,
44+
],
2845
})
2946
export class AutocompleteDemo {
3047
stateCtrl = new FormControl({code: 'CA', name: 'California'});

src/dev-app/badge/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ ng_module(
1414
"//src/material/button",
1515
"//src/material/icon",
1616
"@npm//@angular/forms",
17-
"@npm//@angular/router",
1817
],
1918
)
2019

src/dev-app/badge/badge-demo-module.ts

-29
This file was deleted.

src/dev-app/badge/badge-demo.ts

+7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@
77
*/
88

99
import {Component} from '@angular/core';
10+
import {CommonModule} from '@angular/common';
11+
import {FormsModule} from '@angular/forms';
12+
import {MatBadgeModule} from '@angular/material/badge';
13+
import {MatButtonModule} from '@angular/material/button';
14+
import {MatIconModule} from '@angular/material/icon';
1015

1116
@Component({
1217
selector: 'badge-demo',
1318
templateUrl: 'badge-demo.html',
1419
styleUrls: ['badge-demo.css'],
20+
standalone: true,
21+
imports: [CommonModule, FormsModule, MatBadgeModule, MatButtonModule, MatIconModule],
1522
})
1623
export class BadgeDemo {
1724
visible = true;

src/dev-app/baseline/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ ng_module(
1717
"//src/material/radio",
1818
"//src/material/select",
1919
"//src/material/toolbar",
20-
"@npm//@angular/router",
2120
],
2221
)
2322

src/dev-app/baseline/baseline-demo-module.ts

-35
This file was deleted.

src/dev-app/baseline/baseline-demo.ts

+19
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,30 @@
77
*/
88

99
import {Component} from '@angular/core';
10+
import {CommonModule} from '@angular/common';
11+
import {MatCardModule} from '@angular/material/card';
12+
import {MatCheckboxModule} from '@angular/material/checkbox';
13+
import {MatFormFieldModule} from '@angular/material/form-field';
14+
import {MatInputModule} from '@angular/material/input';
15+
import {MatRadioModule} from '@angular/material/radio';
16+
import {MatSelectModule} from '@angular/material/select';
17+
import {MatToolbarModule} from '@angular/material/toolbar';
1018

1119
@Component({
1220
selector: 'baseline-demo',
1321
templateUrl: 'baseline-demo.html',
1422
styleUrls: ['baseline-demo.css'],
23+
standalone: true,
24+
imports: [
25+
CommonModule,
26+
MatCardModule,
27+
MatCheckboxModule,
28+
MatFormFieldModule,
29+
MatInputModule,
30+
MatRadioModule,
31+
MatSelectModule,
32+
MatToolbarModule,
33+
],
1534
})
1635
export class BaselineDemo {
1736
name: string;

src/dev-app/bottom-sheet/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ ng_module(
2020
"//src/material/list",
2121
"//src/material/select",
2222
"@npm//@angular/forms",
23-
"@npm//@angular/router",
2423
],
2524
)
2625

src/dev-app/bottom-sheet/bottom-sheet-demo-module.ts

-41
This file was deleted.

src/dev-app/bottom-sheet/bottom-sheet-demo.ts

+27
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,43 @@
77
*/
88

99
import {Component, TemplateRef, ViewChild} from '@angular/core';
10+
import {CommonModule} from '@angular/common';
11+
import {FormsModule} from '@angular/forms';
1012
import {
1113
MatBottomSheet,
1214
MatBottomSheetConfig,
15+
MatBottomSheetModule,
1316
MatBottomSheetRef,
1417
} from '@angular/material/bottom-sheet';
18+
import {MatButtonModule} from '@angular/material/button';
19+
import {MatCardModule} from '@angular/material/card';
20+
import {MatCheckboxModule} from '@angular/material/checkbox';
21+
import {MatFormFieldModule} from '@angular/material/form-field';
22+
import {MatIconModule} from '@angular/material/icon';
23+
import {MatInputModule} from '@angular/material/input';
24+
import {MatListModule} from '@angular/material/list';
25+
import {MatSelectModule} from '@angular/material/select';
1526

1627
const defaultConfig = new MatBottomSheetConfig();
1728

1829
@Component({
1930
selector: 'bottom-sheet-demo',
2031
styleUrls: ['bottom-sheet-demo.css'],
2132
templateUrl: 'bottom-sheet-demo.html',
33+
standalone: true,
34+
imports: [
35+
CommonModule,
36+
FormsModule,
37+
MatBottomSheetModule,
38+
MatButtonModule,
39+
MatCardModule,
40+
MatCheckboxModule,
41+
MatFormFieldModule,
42+
MatIconModule,
43+
MatInputModule,
44+
MatSelectModule,
45+
MatListModule,
46+
],
2247
})
2348
export class BottomSheetDemo {
2449
config: MatBottomSheetConfig = {
@@ -51,6 +76,8 @@ export class BottomSheetDemo {
5176
</a>
5277
</mat-nav-list>
5378
`,
79+
standalone: true,
80+
imports: [CommonModule, MatListModule],
5481
})
5582
export class ExampleBottomSheet {
5683
constructor(private _bottomSheet: MatBottomSheetRef) {}

src/dev-app/button-toggle/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ng_module(
1313
"//src/material/button-toggle",
1414
"//src/material/checkbox",
1515
"//src/material/icon",
16-
"@npm//@angular/router",
1716
],
1817
)
1918

src/dev-app/button-toggle/button-toggle-demo-module.ts

-29
This file was deleted.

src/dev-app/button-toggle/button-toggle-demo.ts

+7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@
77
*/
88

99
import {Component} from '@angular/core';
10+
import {CommonModule} from '@angular/common';
11+
import {FormsModule} from '@angular/forms';
12+
import {MatButtonToggleModule} from '@angular/material/button-toggle';
13+
import {MatCheckboxModule} from '@angular/material/checkbox';
14+
import {MatIconModule} from '@angular/material/icon';
1015

1116
@Component({
1217
selector: 'button-toggle-demo',
1318
templateUrl: 'button-toggle-demo.html',
1419
styleUrls: ['button-toggle-demo.css'],
20+
standalone: true,
21+
imports: [CommonModule, FormsModule, MatButtonToggleModule, MatCheckboxModule, MatIconModule],
1522
})
1623
export class ButtonToggleDemo {
1724
isVertical = false;

src/dev-app/button/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ng_module(
1313
"//src/components-examples/material/button",
1414
"//src/material/button",
1515
"//src/material/icon",
16-
"@npm//@angular/router",
1716
],
1817
)
1918

0 commit comments

Comments
 (0)