EXCEPTION: Uncaught (in promise): Error: Cannot find module 'app/home/home.module'

后端 未结 11 2480
遇见更好的自我
遇见更好的自我 2021-01-01 12:37

I\'m trying to lazy load Angular 2 modules with the router, and I\'m having this error:

error_handler.js:50 EXCEPTION: Uncaught (in promise): Error: C

11条回答
  •  情歌与酒
    2021-01-01 13:10

    I managed to make it work, here is what I done :

    1 - Make the routing code in the module ( not a file )

    2 - Make the module file in the parent directory of the component

    3 - Delete the 'default' in the export like this

    export DEFAULT class HomeModule { }

    became

    export class HomeModule { }

    you can see that it works with beta 24 here : https://github.com/mauricedb/lazy-routes

    I don't know what is happening !!!

提交回复
热议问题