Skip to content

Commit 96a435d

Browse files
committed
Revert "Bootstrap the application using standalone APIs"
This reverts commit cd066f2.
1 parent 5d7f9f7 commit 96a435d

File tree

2 files changed

+36
-39
lines changed

2 files changed

+36
-39
lines changed

angular/src/main.ts

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,18 @@
11
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2-
import { enableProdMode, provideExperimentalZonelessChangeDetection, APP_INITIALIZER, LOCALE_ID, importProvidersFrom } from '@angular/core';
2+
import { enableProdMode } from '@angular/core';
33
import { environment } from './environments/environment';
4-
import { getCurrentLanguage } from './root.module';
4+
import { RootModule } from './root.module';
55
import { hmrBootstrap } from './hmr';
66

77
import 'moment/min/locales.min';
88
import 'moment-timezone';
9-
import { provideClientHydration, BrowserModule, bootstrapApplication } from '@angular/platform-browser';
10-
import { HTTP_INTERCEPTORS, withInterceptorsFromDi, provideHttpClient } from '@angular/common/http';
11-
import { AbpHttpInterceptor } from 'abp-ng2-module';
12-
import { AppInitializer } from './app-initializer';
13-
import { API_BASE_URL } from '@shared/service-proxies/service-proxies';
14-
import { AppConsts } from '@shared/AppConsts';
15-
import { provideAnimations } from '@angular/platform-browser/animations';
16-
import { SharedModule } from '@shared/shared.module';
17-
import { ModalModule } from 'ngx-bootstrap/modal';
18-
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
19-
import { CollapseModule } from 'ngx-bootstrap/collapse';
20-
import { TabsModule } from 'ngx-bootstrap/tabs';
21-
import { ServiceProxyModule } from '@shared/service-proxies/service-proxy.module';
22-
import { RootRoutingModule } from './root-routing.module';
23-
import { RootComponent } from './root.component';
249

2510
if (environment.production) {
2611
enableProdMode();
2712
}
2813

2914
const bootstrap = () => {
30-
return bootstrapApplication(RootComponent, {
31-
providers: [
32-
importProvidersFrom(BrowserModule, SharedModule.forRoot(), ModalModule.forRoot(), BsDropdownModule.forRoot(), CollapseModule.forRoot(), TabsModule.forRoot(), ServiceProxyModule, RootRoutingModule),
33-
provideExperimentalZonelessChangeDetection(),
34-
provideClientHydration(),
35-
{ provide: HTTP_INTERCEPTORS, useClass: AbpHttpInterceptor, multi: true },
36-
{
37-
provide: APP_INITIALIZER,
38-
useFactory: (appInitializer: AppInitializer) => appInitializer.init(),
39-
deps: [AppInitializer],
40-
multi: true,
41-
},
42-
{ provide: API_BASE_URL, useFactory: () => AppConsts.remoteServiceBaseUrl },
43-
{
44-
provide: LOCALE_ID,
45-
useFactory: getCurrentLanguage,
46-
},
47-
provideAnimations(),
48-
provideHttpClient(withInterceptorsFromDi()),
49-
]
50-
});
15+
return platformBrowserDynamic().bootstrapModule(RootModule, {ngZone: 'noop'});
5116
};
5217

5318
/* "Hot Module Replacement" is enabled as described on

angular/src/root.module.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,36 @@ export function getCurrentLanguage(): string {
2828
return 'en';
2929
}
3030

31-
31+
@NgModule({
32+
imports: [
33+
BrowserModule,
34+
BrowserAnimationsModule,
35+
HttpClientModule,
36+
SharedModule.forRoot(),
37+
ModalModule.forRoot(),
38+
BsDropdownModule.forRoot(),
39+
CollapseModule.forRoot(),
40+
TabsModule.forRoot(),
41+
ServiceProxyModule,
42+
RootRoutingModule,
43+
],
44+
declarations: [RootComponent],
45+
providers: [
46+
provideExperimentalZonelessChangeDetection(),
47+
provideClientHydration(),
48+
{ provide: HTTP_INTERCEPTORS, useClass: AbpHttpInterceptor, multi: true },
49+
{
50+
provide: APP_INITIALIZER,
51+
useFactory: (appInitializer: AppInitializer) => appInitializer.init(),
52+
deps: [AppInitializer],
53+
multi: true,
54+
},
55+
{ provide: API_BASE_URL, useFactory: () => AppConsts.remoteServiceBaseUrl },
56+
{
57+
provide: LOCALE_ID,
58+
useFactory: getCurrentLanguage,
59+
},
60+
],
61+
bootstrap: [RootComponent],
62+
})
63+
export class RootModule {}

0 commit comments

Comments
 (0)