11import {
2- NgModule , Component , Pipe , PipeTransform , enableProdMode ,
2+ Component , Pipe , PipeTransform , enableProdMode , provideZoneChangeDetection ,
33} from '@angular/core' ;
4- import { BrowserModule } from '@angular/platform-browser' ;
5- import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' ;
6- import { provideHttpClient , withFetch } from '@angular/common/http' ;
4+ import { bootstrapApplication } from '@angular/platform-browser' ;
75import { ArrayStore } from 'devextreme-angular/common/data' ;
86import { DxDiagramModule , DxDiagramTypes } from 'devextreme-angular/ui/diagram' ;
97import { Service } from './app.service' ;
@@ -18,13 +16,25 @@ if (window && window.config?.packageConfigPaths) {
1816 modulePrefix = '/app' ;
1917}
2018
19+ @Pipe ( { name : 'stringifyItems' , standalone : true } )
20+ export class StringifyItemsPipe implements PipeTransform {
21+ transform ( items : DxDiagramTypes . Item [ ] , textExpression : string ) : string {
22+ return items
23+ . map ( ( item ) => item . dataItem [ textExpression ] )
24+ . join ( ', ' ) ;
25+ }
26+ }
27+
2128@Component ( {
22- standalone : false ,
2329 selector : 'demo-app' ,
2430 templateUrl : `.${ modulePrefix } /app.component.html` ,
2531 styleUrls : [ `.${ modulePrefix } /app.component.css` ] ,
2632 providers : [ Service ] ,
2733 preserveWhitespaces : true ,
34+ imports : [
35+ DxDiagramModule ,
36+ StringifyItemsPipe ,
37+ ] ,
2838} )
2939export class AppComponent {
3040 dataSource : ArrayStore ;
@@ -56,25 +66,8 @@ export class AppComponent {
5666 }
5767}
5868
59- @Pipe ( { name : 'stringifyItems' , standalone : true } )
60- export class StringifyItemsPipe implements PipeTransform {
61- transform ( items : DxDiagramTypes . Item [ ] , textExpression : string ) : string {
62- return items
63- . map ( ( item ) => item . dataItem [ textExpression ] )
64- . join ( ', ' ) ;
65- }
66- }
67-
68- @NgModule ( {
69- imports : [
70- BrowserModule ,
71- DxDiagramModule ,
72- StringifyItemsPipe ,
69+ bootstrapApplication ( AppComponent , {
70+ providers : [
71+ provideZoneChangeDetection ( { eventCoalescing : true , runCoalescing : true } ) ,
7372 ] ,
74- providers : [ provideHttpClient ( withFetch ( ) ) ] ,
75- declarations : [ AppComponent ] ,
76- bootstrap : [ AppComponent ] ,
77- } )
78- export class AppModule { }
79-
80- platformBrowserDynamic ( ) . bootstrapModule ( AppModule ) ;
73+ } ) ;
0 commit comments