0

My app is run in ElectronJs 8 which is the equivalent of Chrome 80 engine.

With Angular 8, I'm using AOT and my main.ts has something like this in it:

platformBrowser().bootstrapModuleFactory(AppModuleNgFactory)

Based on what I've ready, I don't think the app.module.ngfactory is generated anymore in Angular 9.

So how do I bootstrap the application? Do I revert to what I had before?

platformBrowserDynamic().boostrapModule(AppModule)

Am I loosing the AOT benefit by doing so?

eboakyegyau
  • 225
  • 1
  • 13
Cheetah
  • 13,785
  • 31
  • 106
  • 190
  • Why would you lose AOT by doing so? Also why did you need `platformBrowser().bootstrapModuleFactory(AppModuleNgFactory)` to get AOT? `aot` is an option in the `angular.json` file – Guerric P Feb 20 '20 at 21:39
  • @GuerricP - I may have a misunderstanding of what the first snippet of code is doing vs the second. – Cheetah Feb 20 '20 at 21:47

1 Answers1

0

As you can see in this question: Angular 2 / 4 / 5 - Ahead-of-time compilation how to the line platformBrowser().bootstrapModuleFactory(AppModuleNgFactory) is legacy from the very first versions of Angular. It is not required as of January 2017 to get AOT.

Guerric P
  • 30,447
  • 6
  • 48
  • 86