DEV Community

Discussion on: Angular Best Practices

Collapse
 
anubhab5 profile image
Anubhab Mukherjee

Nice article!
Although I have a doubt with the 5th point. Correct me if I am wrong.
With the above syntax won't we get the below error -

core.js:6456 ERROR Error: Uncaught (in promise): Error: Cannot find module...

I feel its better to use the promise
import('./progress/progress.module').then(m => m.ProgressModule)

Collapse
 
oumaymasghayer profile image
Oumayma JavaScript Developer

Definitely, newer versions of angular allow to use imports in lazy loading which I also prefer.