fix: 不正常的中英文段落合并

This commit is contained in:
Zhicheng Wang 2018-02-28 13:43:40 +08:00
parent 6b1d4a4890
commit 89060a39df
12 changed files with 73 additions and 27 deletions

View File

@ -440,8 +440,12 @@ The template, metadata, and component together describe a view.
模板、元数据和组件共同描绘出这个视图。
Apply other metadata decorators in a similar fashion to guide Angular behavior.
`@Injectable`, `@Input`, and `@Output` are a few of the more popular decorators.其它元数据装饰器用类似的方式来指导 Angular 的行为。
例如`@Injectable`、`@Input`和`@Output`等是一些最常用的装饰器。<br class="clear">
`@Injectable`, `@Input`, and `@Output` are a few of the more popular decorators.
其它元数据装饰器用类似的方式来指导 Angular 的行为。
例如`@Injectable`、`@Input`和`@Output`等是一些最常用的装饰器。
<br class="clear">
The architectural takeaway is that you must add metadata to your code
so that Angular knows what to do.
@ -470,7 +474,13 @@ a mechanism for coordinating parts of a template with parts of a component.
Add binding markup to the template HTML to tell Angular how to connect both sides.
Angular 支持**数据绑定**,一种让模板的各部分与组件的各部分相互合作的机制。
我们往模板 HTML 中添加绑定标记,来告诉 Angular 如何把二者联系起来。As the diagram shows, there are four forms of data binding syntax. Each form has a direction &mdash; to the DOM, from the DOM, or in both directions.如图所示,数据绑定的语法有四种形式。每种形式都有一个方向 —— 绑定到 DOM 、绑定自 DOM 以及双向绑定。<br class="clear">
我们往模板 HTML 中添加绑定标记,来告诉 Angular 如何把二者联系起来。
As the diagram shows, there are four forms of data binding syntax. Each form has a direction &mdash; to the DOM, from the DOM, or in both directions.
如图所示,数据绑定的语法有四种形式。每种形式都有一个方向 —— 绑定到 DOM 、绑定自 DOM 以及双向绑定。
<br class="clear">
The `HeroListComponent` [example](guide/architecture#templates) template has three forms:

View File

@ -136,20 +136,27 @@ Revised samples are clearer and cover all topics discussed
## Miscellaneous (2017-01-05)
## 杂项 (2017-01-05)* [Setup](guide/setup) guide:
added (optional) instructions on how to remove _non-essential_ files. [环境搭建](guide/setup)指南:
添加了(可选的)步骤说明,告诉你如何移除*非核心*文件。
## 杂项 (2017-01-05)
* [Setup](guide/setup) guide:
[环境搭建](guide/setup)指南:
added (optional) instructions on how to remove _non-essential_ files.
添加了(可选的)步骤说明,告诉你如何移除*非核心*文件。
* No longer consolidate RxJS operator imports in `rxjs-extensions` file; each file should import what it needs.
不再在`rxjs-extensions`文件中统一导入RxJS的操作符每个文件应该各自导入它自己所需的。
不再在`rxjs-extensions`文件中统一导入RxJS的操作符每个文件应该各自导入它自己所需的。
* All samples prepend template/style URLs with `./` as a best practice.
所有范例都在模板/样式的URL之前添加`./`前缀 …… 而且你在实际开发中也应该这么做。
所有范例都在模板/样式的URL之前添加`./`前缀 …… 而且你在实际开发中也应该这么做。
* [Style Guide](guide/styleguide): copy edits and revised rules.
[风格指南](guide/styleguide):复制了编辑过的和修改过的规则。
[风格指南](guide/styleguide):复制了编辑过的和修改过的规则。
## Router: more detail (2016-12-21)

View File

@ -1035,10 +1035,11 @@ you'll get a runtime null reference error.
You actually can define the component first with the help of the `forwardRef()` method as explained
in this [blog post](http://blog.thoughtram.io/angular/2015/09/03/forward-references-in-angular-2.html).
But it's best to avoid the problem altogether by defining components and services in separate files.
在`forwardRef()`方法的帮助下,实际上也可以先定义组件,
具体说明见这篇[博客](http://blog.thoughtram.io/angular/2015/09/03/forward-references-in-angular-2.html)。
But it's best to avoid the problem altogether by defining components and services in separate files.
但是为什么要先给自己找麻烦呢?
还是通过在独立的文件中定义组件和服务,完全避免此问题吧。

View File

@ -408,7 +408,8 @@ The list is by no means exhaustive, but should provide you with a good starting
[rewrite rule](http://httpd.apache.org/docs/current/mod/mod_rewrite.html)
to the `.htaccess` file as shown
(https://ngmilk.rocks/2015/03/09/angularjs-html5-mode-or-pretty-urls-on-apache-using-htaccess/):
[Apache](https://httpd.apache.org/):在`.htaccess`文件中添加一个[重写规则](http://httpd.apache.org/docs/current/mod/mod_rewrite.html)
[Apache](https://httpd.apache.org/):在`.htaccess`文件中添加一个[重写规则](http://httpd.apache.org/docs/current/mod/mod_rewrite.html)
代码如下([出处](https://ngmilk.rocks/2015/03/09/angularjs-html5-mode-or-pretty-urls-on-apache-using-htaccess/)
<code-example format=".">
@ -427,8 +428,9 @@ to the `.htaccess` file as shown
[Front Controller Pattern Web Apps](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#front-controller-pattern-web-apps),
modified to serve `index.html`:
[NGinx](http://nginx.org/):使用`try_files`指向`index.html`,详细描述见[Web应用的前端控制器模式](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#front-controller-pattern-web-apps)。
[NGinx](http://nginx.org/):使用`try_files`指向`index.html`,详细描述见[Web应用的前端控制器模式](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#front-controller-pattern-web-apps)。<code-example format=".">
<code-example format=".">
try_files $uri $uri/ /index.html;
</code-example>
@ -437,7 +439,9 @@ modified to serve `index.html`:
* [IIS](https://www.iis.net/): add a rewrite rule to `web.config`, similar to the one shown
[here](http://stackoverflow.com/a/26152011/2116927):
[IIS](https://www.iis.net/):往`web.config`中添加一条重写规则,类似于[这里](http://stackoverflow.com/a/26152011/2116927)<code-example format='.'>
[IIS](https://www.iis.net/):往`web.config`中添加一条重写规则,类似于[这里](http://stackoverflow.com/a/26152011/2116927)
<code-example format='.'>
&lt;system.webServer&gt;
&lt;rewrite&gt;
&lt;rules&gt;
@ -475,13 +479,13 @@ and to
[rewrite rule](https://firebase.google.com/docs/hosting/url-redirects-rewrites#section-rewrites).
[Firebase主机服务](https://firebase.google.com/docs/hosting/):添加一条[重写规则](https://firebase.google.com/docs/hosting/url-redirects-rewrites#section-rewrites)。<code-example format=".">
[Firebase主机服务](https://firebase.google.com/docs/hosting/):添加一条[重写规则](https://firebase.google.com/docs/hosting/url-redirects-rewrites#section-rewrites)。<code-example format=".">
"rewrites": [ {
"source": "**",
"destination": "/index.html"
} ]
</code-example>
</code-example>
{@a cors}

View File

@ -350,7 +350,7 @@ access to all of the template-driven forms features, including `ngModel`.
If a component, directive, or pipe belongs to a module in the `imports` array, _don't_ re-declare it in the `declarations` array.
If you wrote it and it should belong to this module, _do_ declare it in the `declarations` array.
如果某个组件、指令或管道是属于`imports`中所导入的某个模块的那就_不能再_把它再声明到本模块的`declarations`数组中。
如果某个组件、指令或管道是属于`imports`中所导入的某个模块的那就_不能再_把它再声明到本模块的`declarations`数组中。
如果它是你自己写的,并且确实属于当前模块,*才应该*把它声明在`declarations`数组中。

View File

@ -758,10 +758,14 @@ Angular has the following types of modules:
Angular有下列模块类型
* [NgModules](guide/glossary#ngmodule).
For details and examples, see the [NgModules](guide/ngmodules) page.[Angular 模块](guide/glossary#ngmodule),见[Angular 模块](guide/ngmodule)。
For details and examples, see the [NgModules](guide/ngmodules) page.
[Angular 模块](guide/glossary#ngmodule),见[Angular 模块](guide/ngmodule)。
* ES2015 modules, as described in this section.
ES2015模块如本节所述。
</div>

View File

@ -614,7 +614,7 @@ Experienced developers agree that components should be cheap and safe to constru
[explains why](http://misko.hevery.com/code-reviewers-guide/flaw-constructor-does-real-work/)
you should avoid complex constructor logic.
Misko HeveryAngular项目的头,在[这里解释](http://misko.hevery.com/code-reviewers-guide/flaw-constructor-does-real-work/)了你为什么应该避免复杂的构造函数逻辑。
Misko HeveryAngular项目的组长,在[这里解释](http://misko.hevery.com/code-reviewers-guide/flaw-constructor-does-real-work/)了你为什么应该避免复杂的构造函数逻辑。
</div>

View File

@ -4171,7 +4171,12 @@ you should see something like the following URL in the browser address bar.
The interesting part of the URL follows the `...`:
这个URL中有意思的部分是`...`后面的这些:* The `crisis-center` is the primary navigation. `crisis-center`是主导航。
这个URL中有意思的部分是`...`后面的这些:
* The `crisis-center` is the primary navigation.
`crisis-center`是主导航。
* Parentheses surround the secondary route.
圆括号包裹的部分是第二路由。
@ -5820,7 +5825,13 @@ But first, make a few changes to the `AppRoutingModule`.
但是首先,要对`AppRoutingModule`做少量修改。
1. Import `SelectivePreloadingStrategy` into `AppRoutingModule`.
把`SelectivePreloadingStrategy`导入到`AppRoutingModule`中。1. Replace the `PreloadAllModules` strategy in the call to `forRoot` with this `SelectivePreloadingStrategy`. 把`PreloadAllModules`策略替换成对`forRoot`的调用,并且传入这个`SelectivePreloadingStrategy`。
把`SelectivePreloadingStrategy`导入到`AppRoutingModule`中。
1. Replace the `PreloadAllModules` strategy in the call to `forRoot` with this `SelectivePreloadingStrategy`.
把`PreloadAllModules`策略替换成对`forRoot`的调用,并且传入这个`SelectivePreloadingStrategy`。
1. Add the `SelectivePreloadingStrategy` strategy to the `AppRoutingModule` providers array so it can be injected
elsewhere in the app.

View File

@ -403,8 +403,12 @@ Perhaps it's a request to transfer money from the user's account to the attacker
The browser automatically sends the `example-bank.com` cookies (including the authentication cookie) with this request.
该`evil.com`页面立刻发送恶意请求到`example-bank.com`。这个请求可能是从用户账户转账到攻击者的账户。
与该请求一起,浏览器自动发出`example-bank.com`的cookie。If the `example-bank.com` server lacks XSRF protection, it can't tell the difference between a legitimate
request from the application and the forged request from `evil.com`.如果`example-bank.com`服务器缺乏XSRF保护就无法辨识请求是从应用程序发来的合法请求还是从`evil.com`来的假请求。
与该请求一起,浏览器自动发出`example-bank.com`的cookie。
If the `example-bank.com` server lacks XSRF protection, it can't tell the difference between a legitimate
request from the application and the forged request from `evil.com`.
如果`example-bank.com`服务器缺乏XSRF保护就无法辨识请求是从应用程序发来的合法请求还是从`evil.com`来的假请求。
To prevent this, the application must ensure that a user request originates from the real
application, not from a different site.

View File

@ -3401,7 +3401,10 @@ and more difficult in a flat structure.
<div class='file-tree-reference'>
<a href="#file-tree">Refer to this _folder and file structure_ example.</a> <a href="#file-tree">点这里查看目录和文件结构的范例</a>
<a href="#file-tree">Refer to this _folder and file structure_ example.</a>
<a href="#file-tree">点这里查看目录和文件结构的范例</a>
</div>
@ -5601,7 +5604,9 @@ Compare with the less preferred `host` metadata alternative.
**Why?** When providing the service to a top level component,
that instance is shared and available to all child components of that top level component.**为何?**在顶层组件提供服务时,该服务实例在所有子组件中可见并共享。
that instance is shared and available to all child components of that top level component.
**为何?**在顶层组件提供服务时,该服务实例在所有子组件中可见并共享。
</div>

View File

@ -2294,7 +2294,6 @@ Do that in a new file called `ajs-upgraded-providers.ts` and import it in `app.m
来把`$routeParams`包装成Angular的服务提供商。
新建一个名叫`ajs-upgraded-providers.ts`的文件,并且在`app.module.ts`中导入它:
<code-example path="upgrade-phonecat-2-hybrid/app/ajs-upgraded-providers.ts" title="app/ajs-upgraded-providers.ts">
</code-example>

View File

@ -1138,6 +1138,7 @@ they're added behind the scenes by the `angular2-template-loader` plug-in.
`vendor.ts`由`import`提供商依赖的语句组成,它最终决定了`vender.js`的内容。
本应用也导入这些模块,如果没有`CommonsChunkPlugin`插件检测出这种重叠,并且把它们从`app.js`中移除,它们就会同时出现在`app.js`包中。
{@a conclusion}
## Conclusion