platformBrowserDynamic or bootstrapApplication

a few days ago I created a new ionic 7 app.

In the new app version there isn’t app.module file and in order to import my providers I used main.ts file

main.ts file conains this code:

bootstrapApplication(AppComponent, {
  providers: [
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
});

In this file I import all my providers.

Today I created new App and the structure is changed. app.module file is present. main.ts file is changed. It contains:

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.log(err));

Please help me to understand.

Hey! So when we shipped V7, we initially went all in on Angular Standalone mode. This means that ng-modules were no longer needed and we had a simplified way of bootstrapping your applications.

But, Standalone mode in Angular is still relatively new, and the community has been confused about what these changes mean. So we decided to revert these changes and go back to the older ng-modules approach since most people were familiar with that.

2 Likes

@mhartington thanks for the explanation