@@ -2,7 +2,7 @@ import {FocusMonitor} from '@angular/cdk/a11y';
22import { DragDropModule } from '@angular/cdk/drag-drop' ;
33import { ScrollingModule , ViewportRuler } from '@angular/cdk/scrolling' ;
44import { CdkTableModule , DataSource } from '@angular/cdk/table' ;
5- import { Component , ElementRef , NgModule , ErrorHandler } from '@angular/core' ;
5+ import { Component , ElementRef } from '@angular/core' ;
66import { MatNativeDateModule , MatRippleModule } from '@angular/material/core' ;
77import { MatAutocompleteModule } from '@angular/material/autocomplete' ;
88import { MatButtonModule } from '@angular/material/button' ;
@@ -51,52 +51,20 @@ export class TableDataSource extends DataSource<any> {
5151
5252@Component ( {
5353 template : `<button>Do the thing</button>` ,
54+ standalone : true ,
5455} )
5556export class TestEntryComponent { }
5657
5758@Component ( {
5859 selector : 'kitchen-sink' ,
5960 templateUrl : './kitchen-sink.html' ,
60- styles : [
61- `
61+ standalone : true ,
62+ styles : `
6263 .universal-viewport {
6364 height: 100px;
6465 border: 1px solid black;
6566 }
6667 ` ,
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 ( {
10068 imports : [
10169 MatAutocompleteModule ,
10270 MatBadgeModule ,
@@ -143,20 +111,33 @@ export class KitchenSink {
143111 YouTubePlayerModule ,
144112 GoogleMapsModule ,
145113 ] ,
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- ] ,
157114} )
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 ) ;
159137
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+ }
162143}
0 commit comments