Architecture overview

The basic building blocks of an Angular application are NgModules, which provide a compilation context for components. NgModules 

ngModeule是angualr应用基本构建模块,为组件提供了编译的上下文。ngModule

collect related code into functional sets; an Angular app is defined by a set of NgModules. An app always has at least a root module that 

把相关代码组成可运行集合,这些个ngModule的集合就是一个angualr app。一个angular应用至少有一个根模块

enables bootstrapping, and typically has many more feature modules.

,作为启动模块,通常还有很多特征模块。

  • Components define views, which are sets of screen elements that Angular can choose among and modify according to your program logic and data. Every app has at least a root component.

       组件定义了试图,angular可以在屏幕元素集合中选择,并可以依据自己项目逻辑和数据来修改。每个app至少有一个根组件。
  • Components use services, which provide specific functionality not directly related to views. Service providers can be injected into components as dependencies, making your code modular, reusable, and efficient.

        组件可以应用服务,服务是提供的特殊功能间接影响视图。服务提供者可以作为依赖注入到组件中,使你的代码更加模块化、可重用性和高效性。


Both components and services are simply classes, with decorators that mark their type and provide metadata that tells Angular how to use them.

组件和服务都是简单的类,包含了标记他们类型和提供元数据的声明,这些声明告诉angular怎么去使用他们。

  • The metadata for a component class associates it with a template that defines a view. A template combines ordinary HTML with Angular directives and binding markup that allow Angular to modify the HTML before rendering it for display.

    组件类的元数据和模块联系在一起共同定义视图,一个模块结合了普通的HTML和angualr指令,绑定了修饰使得angular可以在渲染视图之前改变HTML。
  • The metadata for a service class provides the information Angular needs to make it available to components through Dependency Injection (DI).

    服务类的元数据提供必要信息,使组件可以通过依赖注入来获取服务信息。


An app's components typically define many views, arranged hierarchically. Angular provides the Router service to help you define 

一个app组件通常定义很多视图,分层排列。angualr提供了路由服务来帮助你来

navigation paths among views. The router provides sophisticated in-browser navigational capabilities. 

定义这些视图的导航路径。路由提供复杂的浏览器导航功能实现。


angular的框架结构的几个主要概念,ngModule、component、metadata、service、views、template、directive、Dependency Injection、router。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值