NgFactory not generated when creating a bundle
I am using Webpack 2 and it seems that a bundle is created and everything works fine. Why are there so many examples given where a factory is generated? Is that a must? Also, is it okay to use platformBrowserDynamic to load this bundle? I see examples where platformBrowser is used to load an ngFactory. Is that a must? I am doing this and it seems to work, but not sure the overhead:
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app'; platformBrowserDynamic() .bootstrapModule(AppModule)
The CLI translates the platform code from dynamic to AoT, and creates the factories, but this is all abstracted away from you.
If you want to see the factories (not the bootstrap transformation, no access to that), I guess you run something like ./node_modules/.bin/ngc -p ./src, but this is not how it's intended to be used. The CLI takes care of all that and you just get the result and not worry about intermediate steps or multiple bootstrapping files, etc.
Okay I suspected that was the case. Thank you for confirming.
Should we be using platformBrowserDynamic or just platformBrowser to load my bundle generated?
Whatever ng new ... generates I guess?
Unless you are suggesting the template needs updating...
The Factories are generated in memory; you won't find them on your disk. Tutorials uses the ngc command line which generates factories on the disk.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.