2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< h1  class = "no-toc" > Introduction to the Angular Docs< / h1 >  
						 
					
						
							
								
									
										
										
										
											2017-04-25 14:48:01 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-07 14:35:57 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
										 
							
							
								< h1  class = "no-toc" > 什么是 Angular? < / h1 >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								These Angular docs help you learn and use the Angular platform and framework, from your first app to optimizing complex enterprise apps. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Tutorials and guides include downloadable example to accelerate your projects. 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-25 14:48:01 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 12:29:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								这份 Angular 文档会帮助你学习和使用 Angular 平台& 框架,从你的第一个应用开始,一直到优化复杂的企业应用。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								这些教程和指南中都包含可下载的范例,以加速你的学习。
							 
						 
					
						
							
								
									
										
										
										
											2017-07-30 16:52:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-18 21:31:27 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< div  class = "card-container" >  
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  < a  href = "start"  class = "docs-card"  title = "Angular Getting Started" > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      < section > Learn< / section > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 13:37:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < section > 开始学习< / section > 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p > Create your first Angular app, without any setup< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 13:37:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p > 不需要任何设置,快速创建你的第一个 Angular 应用。< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 12:29:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p  class = "card-footer" > Getting Started< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 13:37:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p  class = "card-footer" > 快速起步< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-25 14:48:01 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  < / a > 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  < a  href = "guide/setup-local"  class = "docs-card" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								    title="Angular Local Environment Setup">
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								      < section > Start Working< / section > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 13:37:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < section > 开始工作< / section > 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p > Set up your local environment with the Angular CLI< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 13:37:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p > 使用 Angular CLI 搭建本地开发环境< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p  class = "card-footer" > Local Setup< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 13:37:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p  class = "card-footer" > 开始搭建< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-16 11:32:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  < / a > 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-03 21:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  < a  href = "guide/architecture"  class = "docs-card"  title = "Angular Architecture" > 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < section > Explore< / section > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 13:37:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < section > 深入探索< / section > 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p > Learn more about Angular apps and framework features< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 13:37:23 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p > 学习 Angular 应用的更多知识及架构特性< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-03 21:06:01 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p  class = "card-footer" > Architecture< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-08 09:28:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								      < p  class = "card-footer" > 架构< / p > 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-25 14:48:01 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  < / a > 
							 
						 
					
						
							
								
									
										
										
										
											2017-04-24 00:24:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< / div >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-04-24 00:24:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Assumptions
  
						 
					
						
							
								
									
										
										
										
											2017-07-30 16:52:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								## 基本假设
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								These docs assume that you are already familiar with HTML, CSS, [JavaScript ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript "Learn JavaScript" ), 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								and some of the tools from the [latest standards ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Language_Resources "Latest JavaScript standards" ), such as [classes ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes "ES2015 Classes" ) and [modules ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import "ES2015 Modules" ). 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								The code samples are written using [TypeScript ](https://www.typescriptlang.org/ "TypeScript" ). 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Most Angular code can be written with just the latest JavaScript, using [types ](https://www.typescriptlang.org/docs/handbook/classes.html "TypeScript Types" ) for dependency injection, and using [decorators ](https://www.typescriptlang.org/docs/handbook/decorators.html "Decorators" ) for metadata.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-04-24 00:24:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-05-16 08:19:28 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 12:29:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
										 
							
							
								本文档假设你已经熟悉了 HTML, , JavaScript ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript "Learn JavaScript" ) 和来自 [最新标准 ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Language_Resources "Latest JavaScript standards" ) 的一些知识,比如  [类 ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes "ES2015 Classes" ) 和 [模块 ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import "ES2015 Modules" )。
							 
						 
					
						
							
								
									
										
										
										
											2019-01-27 22:10:45 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								下列代码范例都是用最新版本的 [TypeScript ](https://www.typescriptlang.org/ "TypeScript" ) 写的。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								大多数 Angular 代码都只能用最新的 JavaScript 编写,它会用 [类型 ](https://www.typescriptlang.org/docs/handbook/classes.html "TypeScript Types" ) 实现依赖注入,还会用[装饰器 ](https://www.typescriptlang.org/docs/handbook/decorators.html "Decorators" )来提供元数据。
							 
						 
					
						
							
								
									
										
										
										
											2017-07-30 16:52:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## Feedback 
  
						 
					
						
							
								
									
										
										
										
											2017-04-24 00:24:40 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-07-30 16:52:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								## 反馈
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< h4 > You can sit with us!< / h4 >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 12:29:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								< h4 > 你也可以和我们一起做贡献!< / h4 >  
						 
					
						
							
								
									
										
										
										
											2017-04-25 14:48:01 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								We want to hear from you. [Report problems or submit suggestions for future docs. ](https://github.com/angular/angular/issues/new/choose "Angular GitHub repository new issue form" )
							 
						 
					
						
							
								
									
										
										
										
											2017-07-30 16:52:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 12:29:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								我们希望听到你的声音。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Contribute to Angular docs by creating
							 
						 
					
						
							
								
									
										
										
										
											2017-04-25 14:48:01 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								[pull requests ](https://github.com/angular/angular/pulls "Angular Github pull requests" )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								on the Angular Github repository.
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								See [Contributing to Angular ](https://github.com/angular/angular/blob/master/CONTRIBUTING.md "Contributing guide" )
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								for information about submission guidelines.  
							 
						 
					
						
							
								
									
										
										
										
											2017-07-30 16:52:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 12:29:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								请到 Github 上的仓库中创建 [Pull Requests ](https://github.com/angular/angular/pulls "Angular Github pull requests" ) 来为 Angular 文档做出贡献。
							 
						 
					
						
							
								
									
										
										
										
											2017-07-30 16:52:20 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								[贡献者指南 ](https://github.com/angular/angular/blob/master/CONTRIBUTING.md "贡献者指南" )将会帮助你更好的为社区做贡献。
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 12:29:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 00:12:55 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								Our community values respectful, supportive communication.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								Please consult and adhere to the [Code of Conduct ](https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md "Contributor code of conduct" ).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-07 12:29:04 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								我们的社区提倡相互尊重、相互支持。
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								参见[社区行为规范 ](https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md "contributor code of conduct" )。