Angular 2 架构

angular 2 应用程序应用主要由以下 8 个部分组成

  1. 模块 (Modules)
  2. 组件 (Components)
  3. 模板 (Templates)
  4. 数据 (Metadata)
  5. 数据绑定 (Data Binding)
  6. 指令 (Directives)
  7. 服务 (Services)
  8. 依赖注入 (Dependency Injection)

下图展示了每个部分是如何相互工作的


图中

  1. 模板 (Templates)是由 Angular 扩展的 html 语法组成

  2. 组件 (Components)类用来管理这些模板

  3. 应用逻辑部分通过服务 (Services)来完成,然后在模块中打包服务与组件, 最后通过引导根模块来启动应用


链接: https://www.fly63.com/course/15_827