What is the role of Angular core module?

前端 未结 3 2177
臣服心动
臣服心动 2021-02-09 10:10

I read an article about organizing folders in Angular and the author uses one called core, in which he creates the core module and insert only services which will b

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-09 10:12

    This concept is a bit confusing, and I grasp it by reading many posts. To make understanding core module, I like share my idea related to Core module.

    The main reason for generating CoreModule is making AppModule a bit leaner.

    For example, imagine, some services like AnalyticService are provided in AppModule, and these services should be instantiated once in whole of your app. To make AppModule cleaner, you could generated CoreModuleand put them into this module.

提交回复
热议问题