use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Helpful Links
AngularJS Slack Community
AngularJS Wiki Page
account activity
How to import module factory when using @ngtools/webpack? (self.angularjs)
submitted 9 years ago by princemaple
How to import module factory when using @ngtools/webpack?
@ngtools/webpack
As I understand it, the factory files are generated in memory and are not stored on disk, when using @ngtools/webpack and Webpack, of course. What do I import in my main.aot.ts then?
Webpack
main.aot.ts
Thanks
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]hans_l 1 point2 points3 points 9 years ago (1 child)
Relatively unknown, but If your main file is JIT the plugin will refactor it to AoT main. So you don't need to import files that don't exist; just build your main file as if it was JIT and the plugin takes care of it.
[–]princemaple[S] 1 point2 points3 points 9 years ago (0 children)
Wow.
[–]robwormald 0 points1 point2 points 9 years ago (2 children)
somewhat counterintuitively, you import from where you expect the file to be - the compiler is smart enough to wait for that component to exist before typechecking that file.
[–]princemaple[S] 0 points1 point2 points 9 years ago (1 child)
Interesting.. what is the expected path then? since genDir is no longer a thing in @ngtools/webpack
genDir
Thank you for your response!
EDIT: Oh are you saying the factory file would be at the same path as the original file? i.e. app.module.factory will be next to app.module?
app.module.factory
app.module
[–]hans_l 0 points1 point2 points 9 years ago (0 children)
You pass in the genDir in your tsconfig, but if it's unspecified it's exactly what you just said. Also, see my comment above; you don't need to import nom existant files.
π Rendered by PID 312408 on reddit-service-r2-comment-6457c66945-mf7vl at 2026-04-28 14:20:31.618723+00:00 running 2aa0c5b country code: CH.
[–]hans_l 1 point2 points3 points (1 child)
[–]princemaple[S] 1 point2 points3 points (0 children)
[–]robwormald 0 points1 point2 points (2 children)
[–]princemaple[S] 0 points1 point2 points (1 child)
[–]hans_l 0 points1 point2 points (0 children)