更新时间:2023-08-25 19:28:34
来自angular.io:
Taken from angular.io:
Angular模块类与JavaScript模块类在三个主要方面不同:
The Angular module classes differ from JavaScript module class in three key respects:
Angular模块仅限制可声明的类.声明式是唯一与Angular相关的类.
An Angular module bounds declarable classes only. Declarables are the only classes that matter to the Angular.
我们没有在一个巨型文件中定义所有成员类(如在JavaScript模块中一样),而是在@NgModule.declarations
列表中列出了该模块的类.
Instead of defining all member classes in one giant file (as in a JavaScript module), we list the module's classes in the @NgModule.declarations
list.