@@ -2,7 +2,7 @@ import {FocusMonitor} from '@angular/cdk/a11y';
2
2
import { DragDropModule } from '@angular/cdk/drag-drop' ;
3
3
import { ScrollingModule , ViewportRuler } from '@angular/cdk/scrolling' ;
4
4
import { CdkTableModule , DataSource } from '@angular/cdk/table' ;
5
- import { Component , ElementRef , NgModule , ErrorHandler } from '@angular/core' ;
5
+ import { Component , ElementRef } from '@angular/core' ;
6
6
import { MatNativeDateModule , MatRippleModule } from '@angular/material/core' ;
7
7
import { MatAutocompleteModule } from '@angular/material/autocomplete' ;
8
8
import { MatButtonModule } from '@angular/material/button' ;
@@ -51,52 +51,20 @@ export class TableDataSource extends DataSource<any> {
51
51
52
52
@Component ( {
53
53
template : `<button>Do the thing</button>` ,
54
+ standalone : true ,
54
55
} )
55
56
export class TestEntryComponent { }
56
57
57
58
@Component ( {
58
59
selector : 'kitchen-sink' ,
59
60
templateUrl : './kitchen-sink.html' ,
60
- styles : [
61
- `
61
+ standalone : true ,
62
+ styles : `
62
63
.universal-viewport {
63
64
height: 100px;
64
65
border: 1px solid black;
65
66
}
66
67
` ,
67
- ] ,
68
- } )
69
- export class KitchenSink {
70
- /** List of columns for the CDK and Material table. */
71
- tableColumns = [ 'userId' ] ;
72
-
73
- /** Data source for the CDK and Material table. */
74
- tableDataSource = new TableDataSource ( ) ;
75
-
76
- /** Data used to render a virtual scrolling list. */
77
- virtualScrollData = Array ( 10000 ) . fill ( 50 ) ;
78
-
79
- constructor (
80
- snackBar : MatSnackBar ,
81
- dialog : MatDialog ,
82
- viewportRuler : ViewportRuler ,
83
- focusMonitor : FocusMonitor ,
84
- elementRef : ElementRef < HTMLElement > ,
85
- bottomSheet : MatBottomSheet ,
86
- ) {
87
- focusMonitor . focusVia ( elementRef , 'program' ) ;
88
- snackBar . open ( 'Hello there' ) ;
89
- dialog . open ( TestEntryComponent ) ;
90
- bottomSheet . open ( TestEntryComponent ) ;
91
-
92
- // Do a sanity check on the viewport ruler.
93
- viewportRuler . getViewportRect ( ) ;
94
- viewportRuler . getViewportSize ( ) ;
95
- viewportRuler . getViewportScrollPosition ( ) ;
96
- }
97
- }
98
-
99
- @NgModule ( {
100
68
imports : [
101
69
MatAutocompleteModule ,
102
70
MatBadgeModule ,
@@ -143,20 +111,33 @@ export class KitchenSink {
143
111
YouTubePlayerModule ,
144
112
GoogleMapsModule ,
145
113
] ,
146
- declarations : [ KitchenSink , TestEntryComponent ] ,
147
- exports : [ KitchenSink , TestEntryComponent ] ,
148
- providers : [
149
- {
150
- // If an error is thrown asynchronously during server-side rendering it'll get logged to stderr,
151
- // but it won't cause the build to fail. We still want to catch these errors so we provide an
152
- // `ErrorHandler` that re-throws the error and causes the process to exit correctly.
153
- provide : ErrorHandler ,
154
- useValue : { handleError : ERROR_HANDLER } ,
155
- } ,
156
- ] ,
157
114
} )
158
- export class KitchenSinkModule { }
115
+ export class KitchenSink {
116
+ /** List of columns for the CDK and Material table. */
117
+ tableColumns = [ 'userId' ] ;
118
+
119
+ /** Data source for the CDK and Material table. */
120
+ tableDataSource = new TableDataSource ( ) ;
121
+
122
+ /** Data used to render a virtual scrolling list. */
123
+ virtualScrollData = Array ( 10000 ) . fill ( 50 ) ;
124
+
125
+ constructor (
126
+ snackBar : MatSnackBar ,
127
+ dialog : MatDialog ,
128
+ viewportRuler : ViewportRuler ,
129
+ focusMonitor : FocusMonitor ,
130
+ elementRef : ElementRef < HTMLElement > ,
131
+ bottomSheet : MatBottomSheet ,
132
+ ) {
133
+ focusMonitor . focusVia ( elementRef , 'program' ) ;
134
+ snackBar . open ( 'Hello there' ) ;
135
+ dialog . open ( TestEntryComponent ) ;
136
+ bottomSheet . open ( TestEntryComponent ) ;
159
137
160
- export function ERROR_HANDLER ( error : Error ) {
161
- throw error ;
138
+ // Do a sanity check on the viewport ruler.
139
+ viewportRuler . getViewportRect ( ) ;
140
+ viewportRuler . getViewportSize ( ) ;
141
+ viewportRuler . getViewportScrollPosition ( ) ;
142
+ }
162
143
}
0 commit comments