fix: 部分 更新 替换成 修改
This commit is contained in:
parent
d0292bbe82
commit
c20a841249
|
@ -173,7 +173,7 @@ Now, if someone extends the `Engine` class, that is not `Car`'s problem.
|
||||||
The _consumer_ of `Car` has the problem. The consumer must update the car creation code to
|
The _consumer_ of `Car` has the problem. The consumer must update the car creation code to
|
||||||
something like this:
|
something like this:
|
||||||
|
|
||||||
`Car` 的*消费者*也有这个问题。消费者必须更新创建这辆车的代码,就像这样:
|
`Car` 的*消费者*也有这个问题。消费者必须修改创建这辆车的代码,就像这样:
|
||||||
|
|
||||||
<code-example path="dependency-injection/src/app/car/car-creations.ts" region="car-ctor-instantiation-with-param" linenums="false">
|
<code-example path="dependency-injection/src/app/car/car-creations.ts" region="car-ctor-instantiation-with-param" linenums="false">
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ Next, update the template.
|
||||||
At the moment it displays the hero's `id` and `name`.
|
At the moment it displays the hero's `id` and `name`.
|
||||||
Fix that to display only the hero's `name` property.
|
Fix that to display only the hero's `name` property.
|
||||||
|
|
||||||
接着,更新一下模板。
|
接着,修改模板。
|
||||||
现在它显示的是英雄的 `id` 和 `name`。
|
现在它显示的是英雄的 `id` 和 `name`。
|
||||||
要修复它,只显示英雄的 `name` 属性就行了。
|
要修复它,只显示英雄的 `name` 属性就行了。
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ directly since you imported `ReactiveFormsModule` from `AppModule`.
|
||||||
and removing objects from the `questions` array.
|
and removing objects from the `questions` array.
|
||||||
|
|
||||||
关键是,你完全根据 `QuestionService` 返回的对象来控制英雄的工作申请表。
|
关键是,你完全根据 `QuestionService` 返回的对象来控制英雄的工作申请表。
|
||||||
要维护这份问卷,只要非常简单的添加、更新和删除 `questions` 数组中的对象就可以了。
|
要维护这份问卷,只要非常简单的添加、修改和删除 `questions` 数组中的对象就可以了。
|
||||||
|
|
||||||
<code-example path="dynamic-form/src/app/question.service.ts" title="src/app/question.service.ts">
|
<code-example path="dynamic-form/src/app/question.service.ts" title="src/app/question.service.ts">
|
||||||
|
|
||||||
|
|
|
@ -877,7 +877,7 @@ that you add to the project as a sibling to `index.html`:
|
||||||
|
|
||||||
Update the `<head>` of `index.html` to include this style sheet:
|
Update the `<head>` of `index.html` to include this style sheet:
|
||||||
|
|
||||||
更新 `index.html` 中的 `<head>`,以包含这个样式表:
|
修改 `index.html` 中的 `<head>`,以包含这个样式表:
|
||||||
|
|
||||||
<code-example path="forms/src/index.html" linenums="false" title="src/index.html (styles)" region="styles">
|
<code-example path="forms/src/index.html" linenums="false" title="src/index.html (styles)" region="styles">
|
||||||
|
|
||||||
|
|
|
@ -2979,7 +2979,7 @@ Update the template with a [class binding](guide/template-syntax#class-binding).
|
||||||
The binding adds the `selected` CSS class when the comparison returns `true` and removes it when `false`.
|
The binding adds the `selected` CSS class when the comparison returns `true` and removes it when `false`.
|
||||||
Look for it within the repeated `<li>` tag as shown here:
|
Look for it within the repeated `<li>` tag as shown here:
|
||||||
|
|
||||||
用[CSS 类绑定](guide/template-syntax#class-binding)更新模板,把它绑定到 `isSelected` 方法上。
|
用 [CSS 类绑定](guide/template-syntax#class-binding)更新模板,把它绑定到 `isSelected` 方法上。
|
||||||
如果该方法返回 `true`,此绑定就会添加 CSS 类 `selected`,否则就移除它。
|
如果该方法返回 `true`,此绑定就会添加 CSS 类 `selected`,否则就移除它。
|
||||||
在 `<li>` 标记中找到它,就像这样:
|
在 `<li>` 标记中找到它,就像这样:
|
||||||
|
|
||||||
|
@ -4920,7 +4920,7 @@ when navigating.
|
||||||
Since you'll be navigating to the *Admin Dashboard* route after logging in, you'll update it to handle the
|
Since you'll be navigating to the *Admin Dashboard* route after logging in, you'll update it to handle the
|
||||||
query parameters and fragment.
|
query parameters and fragment.
|
||||||
|
|
||||||
由于要在登录后导航到*危机管理*特征区的路由,所以你还得更新它,来处理这些全局查询参数和片段。
|
由于要在登录后导航到*危机管理*特征区的路由,所以你还得修改它,来处理这些全局查询参数和片段。
|
||||||
|
|
||||||
<code-example path="router/src/app/admin/admin-dashboard.component.2.ts" linenums="false" title="src/app/admin/admin-dashboard.component.ts (v2)">
|
<code-example path="router/src/app/admin/admin-dashboard.component.2.ts" linenums="false" title="src/app/admin/admin-dashboard.component.ts (v2)">
|
||||||
|
|
||||||
|
|
|
@ -2044,7 +2044,7 @@ The file contents remain:
|
||||||
|
|
||||||
现在,创建一个名叫 `AppModule` 的根 `NgModule` 类。
|
现在,创建一个名叫 `AppModule` 的根 `NgModule` 类。
|
||||||
这里已经有了一个名叫 `app.module.ts` 的文件,其中存放着 AngularJS 的模块。
|
这里已经有了一个名叫 `app.module.ts` 的文件,其中存放着 AngularJS 的模块。
|
||||||
把它改名为 `app.module.ng1.ts`,同时也要在 `index.html` 中更新对应的脚本名。
|
把它改名为 `app.module.ng1.ts`,同时也要在 `index.html` 中修改对应的脚本名。
|
||||||
文件的内容保留:
|
文件的内容保留:
|
||||||
|
|
||||||
<code-example path="upgrade-phonecat-2-hybrid/app/app.module.ajs.ts" title="app.module.ajs.ts">
|
<code-example path="upgrade-phonecat-2-hybrid/app/app.module.ajs.ts" title="app.module.ajs.ts">
|
||||||
|
|
|
@ -772,7 +772,7 @@ Webpack generates file names with cache-busting hash.
|
||||||
Thanks to the `HtmlWebpackPlugin`, you don't have to update the `index.html` file when the hash changes.
|
Thanks to the `HtmlWebpackPlugin`, you don't have to update the `index.html` file when the hash changes.
|
||||||
|
|
||||||
Webpack 生成的文件名中带有“缓存无效哈希(cache-busting hash)”。
|
Webpack 生成的文件名中带有“缓存无效哈希(cache-busting hash)”。
|
||||||
感谢 `HtmlWebpackPlugin` 插件,当这些哈希值变化时,你就不用去更新 `index.html` 了。
|
感谢 `HtmlWebpackPlugin` 插件,当这些哈希值变化时,你就不用去修改 `index.html` 了。
|
||||||
|
|
||||||
There are additional plugins:
|
There are additional plugins:
|
||||||
|
|
||||||
|
|
|
@ -1057,7 +1057,7 @@ You're at the end of your journey, and you've accomplished a lot.
|
||||||
|
|
||||||
* You updated the components to allow adding, editing, and deleting of heroes.
|
* You updated the components to allow adding, editing, and deleting of heroes.
|
||||||
|
|
||||||
你更新了组件,以允许用户添加、编辑和删除英雄。
|
你修改了组件,以允许用户添加、编辑和删除英雄。
|
||||||
|
|
||||||
* You configured an in-memory web API.
|
* You configured an in-memory web API.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue