diff --git a/aio/content/guide/upgrade.md b/aio/content/guide/upgrade.md index b226737a80..e337ae7f72 100644 --- a/aio/content/guide/upgrade.md +++ b/aio/content/guide/upgrade.md @@ -44,6 +44,7 @@ make incremental upgrading seamless. Angular `upgrade`模块的设计目标就是让你渐进、无缝的完成升级。 ## Preparation + ## 准备工作 There are many ways to structure AngularJS applications. When you begin @@ -59,7 +60,7 @@ AngularJS应用程序的组织方式有很多种。当我们想把它们升级 ### Follow the AngularJS Style Guide -### 遵循Angular风格指南 +### 遵循AngularJS风格指南 The [AngularJS Style Guide](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md) collects patterns and practices that have been proven to result in @@ -67,8 +68,8 @@ cleaner and more maintainable AngularJS applications. It contains a wealth of information about how to write and organize AngularJS code - and equally importantly - how **not** to write and organize AngularJS code. -[Angular风格指南](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md)收集了一些已证明能写出干净且可维护的AngularJS程序的模式与实践。 -它包含了很多关于如何书写和组织Angular代码的有价值信息,同样重要的是,**不应该**采用的书写和组织Angular代码的方式。 +[AngularJS风格指南](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md)收集了一些已证明能写出干净且可维护的AngularJS程序的模式与实践。 +它包含了很多关于如何书写和组织AngularJS代码的有价值信息,同样重要的是,**不应该**采用的书写和组织AngularJS代码的方式。 Angular is a reimagined version of the best parts of AngularJS. In that sense, its goals are the same as the AngularJS Style Guide's: To preserve @@ -77,13 +78,13 @@ more to Angular than just that of course, but this does mean that *following the style guide helps make your AngularJS app more closely aligned with Angular*. -Angular是一个基于AngularJS中最好的部分构思出来的版本。在这种意义上,它的目标和Angular风格指南是一样的: +Angular是一个基于AngularJS中最好的部分构思出来的版本。在这种意义上,它的目标和AngularJS风格指南是一样的: 保留AngularJS中好的部分,去掉坏的部分。当然,Angular还做了更多。 说这些的意思是:*遵循这个风格指南可以让你写出更接近Angular程序的AngularJS程序*。 There are a few rules in particular that will make it much easier to do *an incremental upgrade* using the Angular `upgrade/static` module: -有一些特别的规则可以让使用Angular的`upgrade`模块进行*增量升级*变得更简单: +有一些特别的规则可以让使用Angular的`upgrade/static`模块进行*增量升级*变得更简单: * The [Rule of 1](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#single-responsibility) states that there should be one component per file. This not only makes @@ -92,8 +93,8 @@ There are a few rules in particular that will make it much easier to do *an incr each controller, component, service, and filter is in its own source file. [单一规则](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#single-responsibility) - 规定每个文件应该只放一个组件。这不仅让组件更容易浏览和查找,而且还将允许我们逐个迁移它们的语言和框架。 - 在这个范例程序中,每个控制器、工厂和过滤器都在它自己的源文件中。 + 规定每个文件应该只放一个组件。这不仅让组件更容易浏览和查找,而且还让我们能逐个迁移它们的语言和框架。 + 在这个范例程序中,每个控制器、工厂和过滤器都位于各自的源文件中。 * The [Folders-by-Feature Structure](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#folders-by-feature-structure) and [Modularity](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#modularity) @@ -123,10 +124,9 @@ doesn't work that well if you have to load all those files to the HTML page with <script> tags. Especially when you also have to maintain those tags in the correct order. That's why it's a good idea to start using a *module loader*. -当我们把应用代码分解成每个文件中放一个组件之后,我们通常会得到一个由大量相对较小的文件组成的项目结构。 +当我们把应用代码分解到每个文件中只放一个组件的粒度后,我们通常会得到一个由大量相对较小的文件组成的项目结构。 这比组织成少量大文件要整洁得多,但如果你不得不通过`