fix: 教程中的“我们”改成了“你”
This commit is contained in:
parent
524bb11cd5
commit
636c072823
|
@ -129,7 +129,7 @@ The following table lists some of the key AngularJS template features with their
|
|||
|
||||
This example filters the `title` property to uppercase.
|
||||
|
||||
在这个例子中,我们把`title`属性过滤成了大写形式。
|
||||
这个例子中把`title`属性过滤成了大写形式。
|
||||
|
||||
</td>
|
||||
|
||||
|
@ -188,7 +188,7 @@ The following table lists some of the key AngularJS template features with their
|
|||
|
||||
Angular has true template input variables that are explicitly defined using the `let` keyword.
|
||||
|
||||
在Angular中,我们有了真正的模板输入变量,它需要使用`let`关键字进行明确定义。
|
||||
Angular 有了真正的模板输入变量,它需要使用`let`关键字进行明确定义。
|
||||
|
||||
For more information, see the [ngFor micro-syntax](guide/template-syntax#microsyntax)
|
||||
section of the [Template Syntax](guide/template-syntax) page.
|
||||
|
@ -282,7 +282,7 @@ AngularJS 为模板提供了七十多个内置指令。
|
|||
and the application's root component (`AppComponent`) in `app.module.ts`.
|
||||
|
||||
Angular 没有引导指令。
|
||||
我们总是通过显式调用一个`bootstrap`函数,并传入应用模块的名字(`AppComponent`)来启动应用。
|
||||
总是要通过显式调用一个`bootstrap`函数,并传入应用模块的名字(`AppComponent`)来启动应用。
|
||||
|
||||
</td>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
The _Tour of Heroes_ tutorial covers the fundamentals of Angular.
|
||||
In this tutorial you will build an app that helps a staffing agency manage its stable of heroes.
|
||||
|
||||
**英雄指南**教程涵盖了 Angular 的核心原理。在本教程中,我们将构建一个应用,来帮助招聘机构来管理一群英雄。
|
||||
**英雄指南**教程涵盖了 Angular 的核心原理。在本教程中,你将构建一个应用,来帮助招聘机构来管理一群英雄。
|
||||
|
||||
This basic app has many of the features you'd expect to find in a data-driven application.
|
||||
It acquires and displays a list of heroes, edits a selected hero's detail, and navigates among different views of heroic data.
|
||||
|
@ -15,7 +15,7 @@ It acquires and displays a list of heroes, edits a selected hero's detail, and n
|
|||
|
||||
By the end of the tutorial you will be able to do the following:
|
||||
|
||||
在本教程的最后,我们将完成下列工作:
|
||||
在本教程的最后,你将完成下列工作:
|
||||
|
||||
* Use built-in Angular directives to show and hide elements and display lists of hero data.
|
||||
|
||||
|
@ -56,7 +56,7 @@ By the end of the tutorial you will be able to do the following:
|
|||
You'll learn enough Angular to get started and gain confidence that
|
||||
Angular can do whatever you need it to do.
|
||||
|
||||
完成本教程后,我们将学到足够的 Angular 知识,并确信 Angular 确实能提供我们所需的支持。
|
||||
你将学到足够的 Angular 知识,并确信 Angular 确实能提供你所需的支持。
|
||||
|
||||
After completing all tutorial steps, the final app will look like this <live-example name="toh-pt6"></live-example>.
|
||||
|
||||
|
@ -64,12 +64,12 @@ After completing all tutorial steps, the final app will look like this <live-exa
|
|||
|
||||
## What you'll build
|
||||
|
||||
## 我们要构建出什么
|
||||
## 你要构建出什么
|
||||
|
||||
Here's a visual idea of where this tutorial leads, beginning with the "Dashboard"
|
||||
view and the most heroic heroes:
|
||||
|
||||
下面是本教程关于界面的构想:开始是“Dashboard(仪表盘)”视图,来展示我们最勇敢的英雄。
|
||||
下面是本教程关于界面的构想:开始是“Dashboard(仪表盘)”视图,来展示最勇敢的英雄。
|
||||
|
||||
<figure>
|
||||
<img src='generated/images/guide/toh/heroes-dashboard-1.png' alt="Output of heroes dashboard">
|
||||
|
@ -79,12 +79,12 @@ You can click the two links above the dashboard ("Dashboard" and "Heroes")
|
|||
to navigate between this Dashboard view and a Heroes view.
|
||||
|
||||
仪表盘顶部中有两个链接:“Dashboard(仪表盘)”和“Heroes(英雄列表)”。
|
||||
我们将点击它们在“仪表盘”和“英雄列表”视图之间导航。
|
||||
你将点击它们在“仪表盘”和“英雄列表”视图之间导航。
|
||||
|
||||
If you click the dashboard hero "Magneta," the router opens a "Hero Details" view
|
||||
where you can change the hero's name.
|
||||
|
||||
当我们点击仪表盘上名叫“Magneta”的英雄时,路由将把我们带到这个英雄的详情页,在这里,我们可以修改英雄的名字。
|
||||
当你点击仪表盘上名叫“Magneta”的英雄时,路由会打开英雄详情页,在这里,你可以修改英雄的名字。
|
||||
|
||||
<figure>
|
||||
<img src='generated/images/guide/toh/hero-details-1.png' alt="Details of hero in app">
|
||||
|
@ -95,8 +95,8 @@ Links at the top take you to either of the main views.
|
|||
If you click "Heroes," the app displays the "Heroes" master list view.
|
||||
|
||||
点击“Back(后退)”按钮将返回到“Dashboard(仪表盘)”。
|
||||
顶部的链接可以把我们带到任何一个主视图。
|
||||
如果我们点击“Heroes(英雄列表)”链接,应用将把我们带到“英雄”主列表视图。
|
||||
顶部的链接可以把你带到任何一个主视图。
|
||||
如果你点击“Heroes(英雄列表)”链接,应用将把你带到“英雄”主列表视图。
|
||||
|
||||
<figure>
|
||||
<img src='generated/images/guide/toh/heroes-list-2.png' alt="Output of heroes list app">
|
||||
|
@ -104,16 +104,16 @@ If you click "Heroes," the app displays the "Heroes" master list view.
|
|||
|
||||
When you click a different hero name, the read-only mini detail beneath the list reflects the new choice.
|
||||
|
||||
当我们点击另一位英雄时,一个只读的“微型详情视图”会显示在列表下方,以体现我们的选择。
|
||||
当你点击另一位英雄时,一个只读的“微型详情视图”会显示在列表下方,以体现你的选择。
|
||||
|
||||
You can click the "View Details" button to drill into the
|
||||
editable details of the selected hero.
|
||||
|
||||
我们可以点击“View Details(查看详情)”按钮进入所选英雄的编辑视图。
|
||||
你可以点击“View Details(查看详情)”按钮进入所选英雄的编辑视图。
|
||||
|
||||
The following diagram captures all of the navigation options.
|
||||
|
||||
下面这张图汇总了我们所有可能的导航路径。
|
||||
下面这张图汇总了所有可能的导航路径。
|
||||
|
||||
<figure>
|
||||
<img src='generated/images/guide/toh/nav-diagram.png' alt="View navigations">
|
||||
|
@ -121,7 +121,7 @@ The following diagram captures all of the navigation options.
|
|||
|
||||
Here's the app in action:
|
||||
|
||||
下图演示了我们应用中的所有操作。
|
||||
下图演示了本应用中的动图。
|
||||
|
||||
<figure>
|
||||
<img src='generated/images/guide/toh/toh-anim.gif' alt="Tour of Heroes in Action">
|
||||
|
|
|
@ -7,7 +7,7 @@ Next you will create a new component to display hero information
|
|||
and place that component in the application shell.
|
||||
|
||||
应用程序现在有了基本的标题。
|
||||
接下来我们要创建一个新的组件来显示英雄信息并且把这个组件放到应用程序的外壳里去。
|
||||
接下来你要创建一个新的组件来显示英雄信息并且把这个组件放到应用程序的外壳里去。
|
||||
|
||||
## Create the heroes component
|
||||
|
||||
|
@ -265,7 +265,7 @@ Here it binds the `hero.name` property to the HTML textbox so that data can flow
|
|||
|
||||
Notice that the app stopped working when you added `[(ngModel)]`.
|
||||
|
||||
注意,当我们加上 `[(ngModel)]` 之后这个应用无法工作了。
|
||||
注意,当你加上 `[(ngModel)]` 之后这个应用无法工作了。
|
||||
|
||||
To see the error, open the browser development tools and look in the console
|
||||
for a message like
|
||||
|
|
|
@ -215,7 +215,7 @@ and update the hero detail.
|
|||
|
||||
Add a click event binding to the `<li>` like this:
|
||||
|
||||
我们再往`<li>`元素上插入一句点击事件的绑定代码:
|
||||
再往`<li>`元素上插入一句点击事件的绑定代码:
|
||||
|
||||
<code-example path="toh-pt2/src/app/heroes/heroes.component.1.html" region="selectedHero-click" title="heroes.component.html (template excerpt)" linenums="false">
|
||||
|
||||
|
@ -414,7 +414,7 @@ The finished `<li>` looks like this:
|
|||
|
||||
Your app should look like this <live-example></live-example>.
|
||||
|
||||
我们的应用现在变成了这样:<live-example></live-example>。
|
||||
本应用现在变成了这样:<live-example></live-example>。
|
||||
|
||||
Here are the code files discussed on this page, including the `HeroesComponent` styles.
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ Open the `HeroesComponent` class file.
|
|||
Delete the `HEROES` import as you won't need that anymore.
|
||||
Import the `HeroService` instead.
|
||||
|
||||
删除 `HEROES` 导入,我们以后不会再用它了。
|
||||
删除 `HEROES` 导入,你以后不会再用它了。
|
||||
转而导入 `HeroService`。
|
||||
|
||||
<code-example path="toh-pt4/src/app/heroes/heroes.component.ts" title="src/app/heroes/heroes.component.ts (import HeroService)" region="hero-service-import">
|
||||
|
|
|
@ -750,7 +750,7 @@ The browser refreshes and the app crashes with a compiler error.
|
|||
Add it now.
|
||||
|
||||
刷新浏览器,应用挂了。出现一个编译错误,因为 `HeroService` 没有一个名叫 `getHero()` 的方法。
|
||||
我们这就添加它。
|
||||
这就添加它。
|
||||
|
||||
### Add *HeroService.getHero()*
|
||||
|
||||
|
@ -851,7 +851,7 @@ from heroes list to the mini detail to the hero details and back to the heroes a
|
|||
|
||||
You've met all of the navigational requirements that propelled this page.
|
||||
|
||||
我们已经满足了在本章开头设定的所有导航需求。
|
||||
你已经满足了在本章开头设定的所有导航需求。
|
||||
|
||||
## Final code review
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ so it's generalized to meet their different needs.
|
|||
Instead of handling the error directly, it returns an _error handler_ function to `catchError` that it
|
||||
has configured with both the name of the operation that failed and a safe return value.
|
||||
|
||||
它不再直接处理这些错误,而是返回给 `catchError` 返回一个*错误处理*函数。我们还要用操作名和出错时要返回的安全值来对这个错误处理函数进行配置。
|
||||
它不再直接处理这些错误,而是返回给 `catchError` 返回一个*错误处理*函数。还要用操作名和出错时要返回的安全值来对这个错误处理函数进行配置。
|
||||
|
||||
<code-example
|
||||
path="toh-pt6/src/app/hero.service.ts"
|
||||
|
@ -522,7 +522,7 @@ the heading:
|
|||
In response to a click event, call the component's click handler and then
|
||||
clear the input field so that it's ready for another name.
|
||||
|
||||
当点击事件触发时,我们调用组件的点击处理器,然后清空这个输入框,以便用来输入另一个名字。
|
||||
当点击事件触发时,调用组件的点击处理器,然后清空这个输入框,以便用来输入另一个名字。
|
||||
|
||||
<code-example path="toh-pt6/src/app/heroes/heroes.component.ts" region="add" title="src/app/heroes/heroes.component.ts (add)"></code-example>
|
||||
|
||||
|
@ -686,7 +686,7 @@ Your goal is to issue only as many requests as necessary.
|
|||
|
||||
Start by adding a `searchHeroes` method to the `HeroService`.
|
||||
|
||||
我们先把 `searchHeroes` 方法添加到 `HeroService` 中。
|
||||
先把 `searchHeroes` 方法添加到 `HeroService` 中。
|
||||
|
||||
<code-example
|
||||
path="toh-pt6/src/app/hero.service.ts"
|
||||
|
@ -947,7 +947,7 @@ If you enter characters that match any existing hero names, you'll see something
|
|||
|
||||
Your app should look like this <live-example></live-example>.
|
||||
|
||||
我们的应用现在变成了这样:<live-example></live-example>。
|
||||
你的应用现在变成了这样:<live-example></live-example>。
|
||||
|
||||
Here are the code files discussed on this page (all in the `src/app/` folder).
|
||||
|
||||
|
@ -1043,31 +1043,31 @@ Here are the code files discussed on this page (all in the `src/app/` folder).
|
|||
|
||||
You're at the end of your journey, and you've accomplished a lot.
|
||||
|
||||
旅程即将结束,不过我们已经收获颇丰。
|
||||
旅程即将结束,不过你已经收获颇丰。
|
||||
|
||||
* You added the necessary dependencies to use HTTP in the app.
|
||||
|
||||
我们添加了在应用程序中使用 HTTP 的必备依赖。
|
||||
你添加了在应用程序中使用 HTTP 的必备依赖。
|
||||
|
||||
* You refactored `HeroService` to load heroes from a web API.
|
||||
|
||||
我们重构了`HeroService`,以通过 web API 来加载英雄数据。
|
||||
你重构了`HeroService`,以通过 web API 来加载英雄数据。
|
||||
|
||||
* You extended `HeroService` to support `post()`, `put()`, and `delete()` methods.
|
||||
|
||||
我们扩展了`HeroService`来支持 `post()`、`put()` 和 `delete()` 方法。
|
||||
你扩展了`HeroService`来支持 `post()`、`put()` 和 `delete()` 方法。
|
||||
|
||||
* You updated the components to allow adding, editing, and deleting of heroes.
|
||||
|
||||
我们更新了组件,以允许用户添加、编辑和删除英雄。
|
||||
你更新了组件,以允许用户添加、编辑和删除英雄。
|
||||
|
||||
* You configured an in-memory web API.
|
||||
|
||||
我们配置了一个内存 Web API。
|
||||
你配置了一个内存 Web API。
|
||||
|
||||
* You learned how to use Observables.
|
||||
|
||||
我们学会了如何使用“可观察对象”。
|
||||
你学会了如何使用“可观察对象”。
|
||||
|
||||
This concludes the "Tour of Heroes" tutorial.
|
||||
You're ready to learn more about Angular development in the fundamentals section,
|
||||
|
|
Loading…
Reference in New Issue