Skip to content

Commit 3bef142

Browse files
fix demos to angular 21 syntax
1 parent a910d5f commit 3bef142

File tree

3 files changed

+22
-36
lines changed

3 files changed

+22
-36
lines changed

apps/demos/Demos/Popup/Scrolling/Angular/app/app.component.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Component, NgModule, enableProdMode } from '@angular/core';
2-
import { BrowserModule } from '@angular/platform-browser';
1+
import { Component, NgModule, enableProdMode, provideZoneChangeDetection } from '@angular/core';
2+
import { bootstrapApplication } from '@angular/platform-browser';
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
44
import { DxPopupModule, DxScrollViewModule } from 'devextreme-angular';
55
import { DxButtonModule, DxButtonTypes } from 'devextreme-angular/ui/button';
@@ -15,10 +15,14 @@ if (window && window.config?.packageConfigPaths) {
1515
}
1616

1717
@Component({
18-
standalone: false,
1918
selector: 'demo-app',
2019
templateUrl: `.${modulePrefix}/app.component.html`,
2120
styleUrls: [`.${modulePrefix}/app.component.css`],
21+
imports: [
22+
DxPopupModule,
23+
DxButtonModule,
24+
DxScrollViewModule,
25+
],
2226
})
2327

2428
export class AppComponent {
@@ -46,17 +50,8 @@ export class AppComponent {
4650
}
4751
}
4852

49-
@NgModule({
50-
imports: [
51-
BrowserModule,
52-
DxPopupModule,
53-
DxButtonModule,
54-
DxScrollViewModule,
53+
bootstrapApplication(AppComponent, {
54+
providers: [
55+
provideZoneChangeDetection({ eventCoalescing: true, runCoalescing: true }),
5556
],
56-
declarations: [AppComponent],
57-
bootstrap: [AppComponent],
58-
})
59-
60-
export class AppModule { }
61-
62-
platformBrowserDynamic().bootstrapModule(AppModule);
57+
});

apps/demos/Demos/Scheduler/Templates/Angular/app/app.component.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ <h3>DXCinema Show Times</h3>
4141
>Ticket Price:
4242
<strong>{{ "$" + model.targetedAppointmentData.price }}</strong>
4343
</div>
44-
<div class="dropdown-appointment-dates">
45-
{{
46-
(model.targetedAppointmentData.displayStartDate
47-
| date : "shortTime") +
44+
<div class="dropdown-appointment-dates">{{
45+
(model.targetedAppointmentData.displayStartDate | date : "shortTime") +
4846
" - " +
4947
(model.targetedAppointmentData.displayEndDate | date : "shortTime")
50-
}}
51-
</div>
48+
}}</div>
5249
</div>
5350
</div>
5451

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { NgModule, Component, enableProdMode } from '@angular/core';
2-
import { BrowserModule } from '@angular/platform-browser';
1+
import { Component, enableProdMode, provideZoneChangeDetection } from '@angular/core';
2+
import { bootstrapApplication } from '@angular/platform-browser';
33
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
44
import { HttpClient, provideHttpClient, withFetch } from '@angular/common/http';
55
import { lastValueFrom } from 'rxjs';
6+
67
import { DxTreeViewComponent, DxTreeViewModule } from 'devextreme-angular';
78

89
if (!/localhost/.test(document.location.host)) {
@@ -16,10 +17,10 @@ if (window && window.config?.packageConfigPaths) {
1617
}
1718

1819
@Component({
19-
standalone: false,
2020
selector: 'demo-app',
2121
templateUrl: `.${modulePrefix}/app.component.html`,
2222
providers: [],
23+
imports: [DxTreeViewModule],
2324
})
2425
export class AppComponent {
2526
createChildren: DxTreeViewComponent['createChildren'];
@@ -35,15 +36,8 @@ export class AppComponent {
3536
}
3637
}
3738

38-
@NgModule({
39-
imports: [
40-
BrowserModule,
41-
DxTreeViewModule,
39+
bootstrapApplication(AppComponent, {
40+
providers: [
41+
provideZoneChangeDetection({ eventCoalescing: true, runCoalescing: true }),
4242
],
43-
providers: [provideHttpClient(withFetch())],
44-
declarations: [AppComponent],
45-
bootstrap: [AppComponent],
46-
})
47-
export class AppModule { }
48-
49-
platformBrowserDynamic().bootstrapModule(AppModule);
43+
});

0 commit comments

Comments
 (0)