What's the difference between an Angular component and module

前端 未结 7 1785
春和景丽
春和景丽 2020-12-22 14:51

I\'ve been watching videos and reading articles but this specific article make me so confused, at the start of the article it says

The applications in An

7条回答
  •  一个人的身影
    2020-12-22 15:22

    A picture is worth a thousand words !

    The concept of Angular is very simple. It propose to "build" an app with "bricks" -> modules.

    This concept makes it possible to better structure the code and to facilitate reuse and sharing.

    Be careful not to confuse the Angular modules with the ES2015 / TypeScript modules.

    Regarding the Angular module, it is a mechanism for:

    1- group components (but also services, directives, pipes etc ...)

    2- define their dependencies

    3- define their visibility.

    An Angular module is simply defined with a class (usually empty) and the NgModule decorator.

提交回复
热议问题