Angular2: Module and Component difference

后端 未结 2 1420
天命终不由人
天命终不由人 2021-01-07 18:48

I don\'t quite to figure out, why Angular2 have two concepts?

  1. Module

  2. Component

What is the difference between them and w

2条回答
  •  离开以前
    2021-01-07 19:48

    Basically Module and Component both are different terms.

    How ?

    Module in Angular is set of Components, Services, Filters, or some another smaller modules too, or we can say where you import all these in order to use later in the app for future use. in a single app there can be one or more than one module may exist.

    Whereas Component is a single layer or view to perform some actions etc. components can be lazy loaded as per requirements.

提交回复
热议问题