From 27846fdd3eb71a072ab28af7dd07069c6dd622da Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 11 May 2016 17:34:37 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E9=9B=B6=E6=95=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/docs/ts/latest/guide/style-guide.jade | 4 ---- public/docs/ts/latest/tutorial/index.jade | 4 ++-- public/features.jade | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/public/docs/ts/latest/guide/style-guide.jade b/public/docs/ts/latest/guide/style-guide.jade index 83659d2b08..6a608c2f19 100644 --- a/public/docs/ts/latest/guide/style-guide.jade +++ b/public/docs/ts/latest/guide/style-guide.jade @@ -347,11 +347,7 @@ a(href="#toc") 回到顶部 .s-rule.do :marked **Do** use consistent names for all assets named after what they represent. -<<<<<<< HEAD **做** 为所有东西使用统一的命名:以它们所代表的东西命名 -======= - **做** 为所有财产的使用统一的命名:以它们所代表的东西命名 ->>>>>>> f0e75413c854b8966c506c7c351339c9f5e98512 .s-rule.do :marked diff --git a/public/docs/ts/latest/tutorial/index.jade b/public/docs/ts/latest/tutorial/index.jade index e394d340bd..50a129fe89 100644 --- a/public/docs/ts/latest/tutorial/index.jade +++ b/public/docs/ts/latest/tutorial/index.jade @@ -8,14 +8,14 @@ include ../_util-fns Our grand plan is to build an app to help a staffing agency manage its stable of heroes. Even heroes need to find work. - 我们的终极计划是构建一个程序,来帮助职业介绍所管理英雄选择器(译注:比如WoW登录后看到的那个列表就是“英雄选择器”)。毕竟,英雄们也得养家糊口嘛! + 我们的终极计划是构建一个程序,来帮助职业介绍所管理英雄围栏(译注:比如WoW登录后看到的那个列表就是“英雄围栏”)。毕竟,英雄们也得养家糊口嘛! Of course we'll only make a little progress in this tutorial. What we do build will have many of the features we expect to find in a full-blown, data-driven application: acquiring and displaying a list of heroes, editing a selected hero's detail, and navigating among different views of heroic data. - 当然,在这个教程中,我们只完成一小步。我们这次构建的应用将用到很多对特性:获得并显示英雄列表,编辑所选英雄的详情,并在英雄数据的多个视图之间建立导航。这些特性,在全面、数据驱动的应用中经常见到。 + 当然,在这个教程中,我们只完成一小步。我们这次构建的应用将用到很多特性:获得并显示英雄列表,编辑所选英雄的详情,并在英雄数据的多个视图之间建立导航。这些特性,在全面、数据驱动的应用中经常见到。 The Tour of Heroes covers the core fundamentals of Angular. We’ll use built-in directives to show/hide elements and display lists of hero data. diff --git a/public/features.jade b/public/features.jade index e476b6c2a3..7ac9ee3b4d 100644 --- a/public/features.jade +++ b/public/features.jade @@ -71,7 +71,7 @@ div h3 Animation h3 动画 p(class="text-body") Create high performance complex choreographies and animation timelines with very little code through Angular's intuitive API. - p(class="text-body") 通过Angular中直观的API创建高性能复杂编排和动画时间线 —— 只需要非常少量的代码。 + p(class="text-body") 通过Angular中直观简便的API创建高性能复杂编排和动画时间线 —— 只要非常少的代码。 div(class="feature") h3 Accessibility h3 可访问性 From 5c2d545bda85f601eb4a0f7ab7f1411f478de4d9 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 11 May 2016 18:58:41 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E9=9B=B6=E6=95=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/docs/ts/latest/tutorial/index.jade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/docs/ts/latest/tutorial/index.jade b/public/docs/ts/latest/tutorial/index.jade index 50a129fe89..983e07b3ff 100644 --- a/public/docs/ts/latest/tutorial/index.jade +++ b/public/docs/ts/latest/tutorial/index.jade @@ -15,7 +15,7 @@ include ../_util-fns a list of heroes, editing a selected hero's detail, and navigating among different views of heroic data. - 当然,在这个教程中,我们只完成一小步。我们这次构建的应用将用到很多特性:获得并显示英雄列表,编辑所选英雄的详情,并在英雄数据的多个视图之间建立导航。这些特性,在全面、数据驱动的应用中经常见到。 + 当然,在这个教程中,我们只完成一小步。我们这次构建的应用会涉及很多特性:获得并显示英雄列表,编辑所选英雄的详情,并在英雄数据的多个视图之间建立导航。这些特性,在成熟的、数据驱动的应用中经常见到。 The Tour of Heroes covers the core fundamentals of Angular. We’ll use built-in directives to show/hide elements and display lists of hero data. @@ -28,7 +28,7 @@ include ../_util-fns 这个《英雄指南》覆盖了Angular的核心原理。 我们将使用内建指令来显示/隐藏元素,并且显示英雄数据的列表。 我们将创建一个组件来显示英雄的详情,另一个组件则用来显示英雄列表。 - 我们将对只读数据使用单向数据绑定。我们将添加一些可编辑字段,并使用双向数据绑定更新模型。 + 我们将对只读数据使用单向数据绑定。我们将添加一些可编辑字段,并通过双向数据绑定更新模型。 我们将把组件上的方法绑定到用户事件上,比如按键和点击。 我们将学习从主列表视图中选择一个英雄,然后在详情视图中编辑它。 我们将通过管道对数据进行格式化。 From 520e75d200dc9a4120db87f2df254cbc407127e0 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 11 May 2016 19:25:40 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=95=99=E7=A8=8B-=E7=AE=80=E4=BB=8B=20?= =?UTF-8?q?=E4=B8=80=E5=AE=A1=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/docs/ts/latest/tutorial/index.jade | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/public/docs/ts/latest/tutorial/index.jade b/public/docs/ts/latest/tutorial/index.jade index 983e07b3ff..e08eb54a9f 100644 --- a/public/docs/ts/latest/tutorial/index.jade +++ b/public/docs/ts/latest/tutorial/index.jade @@ -40,8 +40,8 @@ include ../_util-fns We'll be covering a lot of ground at an introductory level but we’ll find plenty of links to chapters with greater depth. - 我们将学习足够的Angular核心技术,以尝试起步,并建立信心 —— 证明Angular确实能做到我们需要它做的这些。 - 我们将覆盖大部分“简介级”知识,但是我们还会放上大量链接,指向更深入的章节。 + 我们将学习足够的Angular核心技术,来作为起步,并建立信心 —— 证明Angular确实能做到我们想让它做的。 + 虽然我们将覆盖大部分“简介级”知识,但还是会放上大量链接,指向更深入的章节。 // #enddocregion intro @@ -59,7 +59,7 @@ include ../_util-fns Here's a visual idea of where we're going in this tour, beginning with the "Dashboard" view and our most heroic heroes: - 在这个教程中,还有一些可视化思想。放一个“仪表盘(Dashboard)”视图,来显示我们最勇敢的英雄。 + 在这个教程中,还引入了一些可视化思想:放一个“仪表盘(Dashboard)”视图,来展示我们最勇敢的英雄。 figure.image-display img(src='/resources/images/devguide/toh/heroes-dashboard-1.png' alt="英雄仪表盘的输出") @@ -69,7 +69,7 @@ figure.image-display We could click them to navigate between this Dashboard and a Heroes view. 这个仪表盘中有两个链接:“仪表盘”和“英雄”。 - 我们将点击它们,以便在“仪表盘”和“英雄”视图之间导航。 + 我们将点击它们在“仪表盘”和“英雄”视图之间导航。 Instead we click the dashboard hero named "Magneta" and the router takes us to a "Hero Details" view of that hero where we can change the hero's name. @@ -94,7 +94,7 @@ figure.image-display :marked We click a different hero and the readonly mini-detail beneath the list reflects our new choice. - 当我们点击另一位英雄时,一个只读的“微型视图”会显示在列表下方,以反应我们的选择。 + 当我们点击另一位英雄时,一个只读的“微型视图”会显示在列表下方,以体现我们的选择。 We click the "View Details" button to drill into the editable details of our selected hero. @@ -103,7 +103,7 @@ figure.image-display The following diagram captures all of our navigation options. - 下列图标汇总了我们的所有可选导航路径。 + 下面这个图汇总了我们所有可能的导航路径。 figure.image-display img(src='/resources/images/devguide/toh/nav-diagram.png' alt="查看导航") @@ -111,7 +111,7 @@ figure.image-display :marked Here's our app in action - 下面是我们应用的所有动作 + 下图演示了我们应用中的所有操作。 figure.image-display img(src='/resources/images/devguide/toh/toh-anim.gif' alt="英雄指南的所有动作") @@ -125,12 +125,12 @@ figure.image-display We'll motivate each step with a requirement that we've met in countless applications. Everything has a reason. - 我们将共同一步步的构建出《英雄指南》。 - 我们将通过与无数应用中类似的需求,驱动我们走向下一步。任何事,都会有理由。 + 让我们一起,一步步构建出《英雄指南》。 + 我们将让和无数应用类似的需求,驱动我们走向下一步。任何事,都会有理由。 And we’ll meet many of the core fundamentals of Angular along the way. - 这一路,我们将遇到Angular的大量核心原则。 + 这一路上,我们将遇到很多Angular核心原理。 [Let's get started!](./toh-pt1.html) From bca76787bb84bfc0843729ca1b2bc416514eac4d Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 11 May 2016 19:30:44 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E9=83=A8=E5=88=86=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=9B=91=E8=A7=86=20=E2=80=94=E2=80=94=20?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E5=8F=AA=E9=80=82=E7=94=A8=E4=BA=8Elisten?= =?UTF-8?q?=E7=9A=84=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/ts/latest/cookbook/component-communication.jade | 4 ++-- public/docs/ts/latest/guide/displaying-data.jade | 2 +- public/docs/ts/latest/guide/forms.jade | 2 +- public/docs/ts/latest/quickstart.jade | 8 ++++---- public/docs/ts/latest/tutorial/toh-pt1.jade | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/public/docs/ts/latest/cookbook/component-communication.jade b/public/docs/ts/latest/cookbook/component-communication.jade index 885157ae3f..160b78c314 100644 --- a/public/docs/ts/latest/cookbook/component-communication.jade +++ b/public/docs/ts/latest/cookbook/component-communication.jade @@ -105,7 +105,7 @@ figure.image-display Use an input property setter to intercept and act upon a value from the parent. - 使用一个Input属性setter,在父级监听子级属性,并对属性值变化采取行动。 + 使用一个Input属性setter,在父级拦截子级属性,并对属性值变化采取行动。 The setter of the `name` input property in the child `NameChildComponent` trims the whitespace from a name and replaces an empty value with default text. @@ -152,7 +152,7 @@ figure.image-display :marked May prefer this approach to the property setter when watching multiple, interacting input properties. - 当监听多个互动Input属性的时候,本方法比属性setter更合适。 + 当监视多个互动Input属性的时候,本方法比属性setter更合适。 Learn about `ngOnChanges` in the [LifeCycle Hooks](../guide/lifecycle-hooks.html) chapter. diff --git a/public/docs/ts/latest/guide/displaying-data.jade b/public/docs/ts/latest/guide/displaying-data.jade index 04e0d0a695..37ec45a530 100644 --- a/public/docs/ts/latest/guide/displaying-data.jade +++ b/public/docs/ts/latest/guide/displaying-data.jade @@ -118,7 +118,7 @@ include ../_quickstart_repo We're ready to see changes in a running app by firing up the npm script that both compiles and serves our applications while watching for changes. - 通过运行npm脚本(它能编译并启动一个能监听变化的服务器),我们能看到运行中的应用发生的变化。 + 通过运行npm脚本(它能编译并启动一个能监视变化的服务器),我们能看到运行中的应用发生的变化。 code-example(format=""). npm start :marked diff --git a/public/docs/ts/latest/guide/forms.jade b/public/docs/ts/latest/guide/forms.jade index cdc6fb4998..88cc356b34 100644 --- a/public/docs/ts/latest/guide/forms.jade +++ b/public/docs/ts/latest/guide/forms.jade @@ -948,7 +948,7 @@ figure.image-display control* is valid. `NgForm`指令使用额外的特性扩充了`form`元素。 - 它保存我们通过`ngControl`属性为各个元素创建的控件类,并且监听它们的属性变化,包括有效性。 + 它保存我们通过`ngControl`属性为各个元素创建的控件类,并且监视它们的属性变化,包括有效性。 它还有自己的`valid`属性,只有当 *每一个被包含的控件* 都有效时,它才有效。 :marked diff --git a/public/docs/ts/latest/quickstart.jade b/public/docs/ts/latest/quickstart.jade index bb240304ee..1a88ea4497 100644 --- a/public/docs/ts/latest/quickstart.jade +++ b/public/docs/ts/latest/quickstart.jade @@ -192,7 +192,7 @@ a(id="package-json") * `npm start` - run the compiler and a server at the same time, both in "watch mode" - * `npm start` - 同时运行编译器和一个服务器,并且都开启"监听模式" + * `npm start` - 同时运行编译器和一个服务器,并且都开启"监视模式" * `npm run tsc` - run the TypeScript compiler once @@ -201,7 +201,7 @@ a(id="package-json") * `npm run tsc:w` - run the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them. - * `npm run tsc:w` - 在监听模式运行TypeScript编译器: + * `npm run tsc:w` - 在监视模式运行TypeScript编译器: 进程持续运行,并等待TypeScript文件发生变化,一旦变化就重新编译它。 * `npm run lite` - run the lite-server, @@ -578,7 +578,7 @@ code-example(format=""). when working with observables. We added the library here in QuickStart so we don't forget later.//TODO this subsection needs to be moved for when we cover the systemjs.config.js - 我们的QuickStart不会用到响应式扩展,但是大量的应用需要它们来提供Observable(译注:响应式编程的核心特性,指监听数据的变更以便做出响应)特性。 + 我们的QuickStart不会用到响应式扩展,但是大量的应用需要它们来提供Observable(译注:响应式编程的核心特性,指监视数据的变更以便做出响应)特性。 我们把它加到QuickStart中,以免将来忘了。//TODO 当我们覆盖到systemjs.config.js时,我们得把这些内容移过去。 :marked @@ -760,7 +760,7 @@ figure.image-display They should detect the change, recompile the TypeScript into JavaScript, refresh the browser, and display the revised message. - TypeScript编译器和`lite-server`都在监听。 + TypeScript编译器和`lite-server`都在监视。 它们会检测到文件的变化,重新把这个TypeScript文件编译成JavaScript文件,刷新浏览器,并且显示修改过的消息。 It's a nifty way to develop an application! diff --git a/public/docs/ts/latest/tutorial/toh-pt1.jade b/public/docs/ts/latest/tutorial/toh-pt1.jade index 3333d5cdcd..6a61cad322 100644 --- a/public/docs/ts/latest/tutorial/toh-pt1.jade +++ b/public/docs/ts/latest/tutorial/toh-pt1.jade @@ -6,7 +6,7 @@ include ../_util-fns Every story starts somewhere. Our story starts where the [QuickStart](../quickstart.html) ends. - 每个故事,都有一个起点。而我们的故事则开始于[QuickStart](../quickstart.html)的结尾处。 + 每一个故事,都有一个起点。而我们的故事则开始于[QuickStart](../quickstart.html)的结尾处。 [Run the live example for part 1](/resources/live-examples/toh-1/ts/plnkr.html) @@ -15,7 +15,7 @@ include ../_util-fns Create a folder called `angular2-tour-of-heroes` and follow the [QuickStart](../quickstart.html) steps which provide the prerequisites, the folder structure, and the core files for our Tour of Heroes. - 创建一个名为`angular2-tour-of-heroes`的文件夹,并且遵循[QuickStart](../quickstart.html)中的步骤初始化它 —— 环境准备、目录结构,以及我们《英雄指南》的核心文件。 + 创建一个名为`angular2-tour-of-heroes`的文件夹,并且遵循[QuickStart](../quickstart.html)中的步骤初始化它 —— 环境准备、目录结构,并放进我们《英雄指南》的核心文件。 include ../_quickstart_repo :marked From a870e4401b3141b6613bfc564903cb652a7d8c91 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 11 May 2016 19:34:38 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E9=83=A8=E5=88=86=E2=80=9C=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=EF=BC=88form=EF=BC=89=E2=80=9D=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E2=80=9C=E5=BD=A2=E5=BC=8F=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/docs/ts/latest/glossary.jade | 4 ++-- public/docs/ts/latest/guide/template-syntax.jade | 2 +- public/docs/ts/latest/quickstart.jade | 2 +- public/docs/ts/latest/tutorial/toh-pt1.jade | 6 +++--- public/docs/ts/latest/tutorial/toh-pt4.jade | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/docs/ts/latest/glossary.jade b/public/docs/ts/latest/glossary.jade index 775535b8f8..186246a899 100644 --- a/public/docs/ts/latest/glossary.jade +++ b/public/docs/ts/latest/glossary.jade @@ -567,7 +567,7 @@ include _util-fns before it is assigned to an element property or displayed between element tags as in this example. - [属性数据绑定](#data-binding) 的格式之一:位于双大括号中的[模板表达式](#template-expression)会被渲染成文本。在被赋值给元素属性或者显示在元素标记中之前,这些文本可能先与周边的文本合并,参见下面的例子。 + [属性数据绑定](#data-binding) 的形式之一:位于双大括号中的[模板表达式](#template-expression)会被渲染成文本。在被赋值给元素属性或者显示在元素标记中之前,这些文本可能先与周边的文本合并,参见下面的例子。 code-example(language="html" escape="html"). @@ -597,7 +597,7 @@ include _util-fns This form is also known as [dash-case](#dash-case). - 这种格式也叫[中线命名法](#dash-case)。 + 这种形式也叫[中线命名法](#dash-case)。 .l-main-section diff --git a/public/docs/ts/latest/guide/template-syntax.jade b/public/docs/ts/latest/guide/template-syntax.jade index 3cda50b68b..9e81bfbb98 100644 --- a/public/docs/ts/latest/guide/template-syntax.jade +++ b/public/docs/ts/latest/guide/template-syntax.jade @@ -1471,7 +1471,7 @@ code-example(format="", language="html"). :marked Alternatively, we can use the canonical prefix form: - 另外,我们也可以使用规范前缀格式: + 另外,我们也可以使用规范前缀形式: // #enddocregion ngModel-2 +makeExample('template-syntax/ts/app/app.component.html', 'NgModel-2')(format=".") // #docregion ngModel-3 diff --git a/public/docs/ts/latest/quickstart.jade b/public/docs/ts/latest/quickstart.jade index 1a88ea4497..23b67b46fd 100644 --- a/public/docs/ts/latest/quickstart.jade +++ b/public/docs/ts/latest/quickstart.jade @@ -390,7 +390,7 @@ a(id="app-component") written in an enhanced form of HTML that tells Angular how to render this component's view. **template**字段指定了此组件的模板。 - 它用一种增强的HTML格式写成,用来告诉Angular如何渲染此组件的视图。 + 它用一种增强的HTML形式写成,用来告诉Angular如何渲染此组件的视图。 >Our template is a single line of HTML announcing "*My First Angular App*". diff --git a/public/docs/ts/latest/tutorial/toh-pt1.jade b/public/docs/ts/latest/tutorial/toh-pt1.jade index 6a61cad322..caa99fa53c 100644 --- a/public/docs/ts/latest/tutorial/toh-pt1.jade +++ b/public/docs/ts/latest/tutorial/toh-pt1.jade @@ -52,7 +52,7 @@ code-example(format="" language="bash"). This command runs the compiler in watch mode, starts the server, launches the app in a browser, and keeps the app running while we continue to build the Tour of Heroes. - 这个命令会在监视模式下运行编译器,启动开发服务器,在浏览器中启动我们的应用,并且在我们构建《英雄指南》的时候让应用得以持续运行。 + 这个命令会在监视模式下运行编译器,启动开发服务器,在浏览器中启动我们的应用,并在我们构建《英雄指南》的时候让应用得以持续运行。 .l-main-section :marked @@ -65,7 +65,7 @@ code-example(format="" language="bash"). Let's add two properties to our `AppComponent`, a `title` property for the application name and a `hero` property for a hero named "Windstorm". - 让我们给`AppComponent`添加两个属性:`title`属性表示应用的名字,而`hero`属性表示一个名叫“Windstorm”的英雄。 + 我们来为`AppComponent`添加两个属性:`title`属性表示应用的名字,而`hero`属性表示一个名叫“Windstorm”的英雄。 +makeExample('toh-1/ts-snippets/app.component.snippets.pt1.ts', 'app-component-1', 'app.component.ts (AppComponent类)')(format=".") @@ -84,7 +84,7 @@ code-example(format="" language="bash"). The double curly braces tell our app to read the `title` and `hero` properties from the component and render them. This is the "interpolation" form of one-way data binding. - 这里的“双大括号”会告诉应用:从组件中读取`title`和`hero`属性,并且渲染它们。这就是单向数据绑定的“插值表达式”格式。 + 这里的“双大括号”会告诉应用:从组件中读取`title`和`hero`属性,并且渲染它们。这就是单向数据绑定的“插值表达式”形式。 .l-sub-section :marked diff --git a/public/docs/ts/latest/tutorial/toh-pt4.jade b/public/docs/ts/latest/tutorial/toh-pt4.jade index 243c04e496..692ed5919c 100644 --- a/public/docs/ts/latest/tutorial/toh-pt4.jade +++ b/public/docs/ts/latest/tutorial/toh-pt4.jade @@ -111,7 +111,7 @@ code-example(format="." language="bash"). The `SpecialSuperHeroService` would be defined in the `special-super-hero.service.ts` file. 我们遵循的文件命名约定是:服务名称的小写形式(基本名),加上`.service`后缀。 - 如果服务名称包含多个字母,我们把基本名部分拼成中线格式(dash-case,也被称作烤串格式kebab-case)。 + 如果服务名称包含多个字母,我们把基本名部分拼成中线形式(dash-case,也被称作烤串形式kebab-case)。 于是,`SpecialSuperHeroService`服务应该被定义在`special-super-hero.service.ts`文件中。 :marked We name the class `HeroService` and export it for others to import. From 0e6820dc0b5cc808d6ed0e3253689deaef8459b8 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 11 May 2016 19:46:09 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E2=80=9C=E6=95=99=E7=A8=8B-=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E7=BC=96=E8=BE=91=E5=99=A8=E2=80=9D=E4=B8=80=E5=AE=A1?= =?UTF-8?q?=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/docs/ts/latest/tutorial/toh-pt1.jade | 52 ++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/public/docs/ts/latest/tutorial/toh-pt1.jade b/public/docs/ts/latest/tutorial/toh-pt1.jade index caa99fa53c..0eb4211fad 100644 --- a/public/docs/ts/latest/tutorial/toh-pt1.jade +++ b/public/docs/ts/latest/tutorial/toh-pt1.jade @@ -90,7 +90,7 @@ code-example(format="" language="bash"). :marked Learn more about interpolation in the [Displaying Data chapter](../guide/displaying-data.html). - 想了解插值表达式的更多知识,参阅[“显示数据”一章](../guide/displaying-data.html)。 + 要了解插值表达式的更多知识,参阅[“显示数据”一章](../guide/displaying-data.html)。 :marked ### Hero object ### Hero对象 @@ -98,7 +98,7 @@ code-example(format="" language="bash"). At the moment, our hero is just a name. Our hero needs more properties. Let's convert the `hero` from a literal string to a class. - 此时此刻,我们的英雄还只有一个名字。显然,我们的英雄应该有更多的属性。 + 此时此刻,我们的英雄还只有一个名字。显然,他/她应该有更多属性。 让我们把`hero`从一个字符串字面量换成一个类。 Create a `Hero` class with `id` and `name` properties. @@ -107,36 +107,36 @@ code-example(format="" language="bash"). 创建一个`Hero`类,它具有`id`和`name`属性。 现在,把下列代码放在`app.component.ts`的顶部,仅次于import语句。 -+makeExample('toh-1/ts/app/app.component.ts', 'hero-class-1', 'app.component.ts (Hero class)')(format=".") ++makeExample('toh-1/ts/app/app.component.ts', 'hero-class-1', 'app.component.ts (Hero类)')(format=".") :marked Now that we have a `Hero` class, let’s refactor our component’s `hero` property to be of type `Hero`. Then initialize it with an id of `1` and the name, "Windstorm". 现在,有了一个`Hero`类,我们就要把组件`hero`属性的类型换成`Hero`了。 - 然后把`1`作为id、把“Windstorm”作为名字,初始化它。 + 然后以`1`为id、以“Windstorm”为名字,初始化它。 -+makeExample('toh-1/ts-snippets/app.component.snippets.pt1.ts', 'hero-property-1', 'app.component.ts (Hero属性)')(format=".") ++makeExample('toh-1/ts-snippets/app.component.snippets.pt1.ts', 'hero-property-1', 'app.component.ts (hero属性)')(format=".") :marked Because we changed the hero from a string to an object, we update the binding in the template to refer to the hero’s `name` property. - 我们把hero从一个字符串换成了对象,于是我们也得更新模板中的绑定表达式,来引用hero的`name`属性。 + 我们把`hero`从一个字符串换成了对象,所以也得更新模板中的绑定表达式,来引用`hero`的`name`属性。 +makeExample('toh-1/ts-snippets/app.component.snippets.pt1.ts', 'show-hero-2') :marked The browser refreshes and continues to display our hero’s name. - 浏览器自动刷新,并且继续显示这位英雄的名字。 + 浏览器自动刷新,并继续显示这位英雄的名字。 ### Adding more HTML ### 添加更多的HTML Displaying a name is good, but we want to see all of our hero’s properties. We’ll add a `
` for our hero’s `id` property and another `
` for our hero’s `name`. - 能显示名字就算不错了,但是我们还想看到我们这位英雄的所有属性。 - 我们将添加一个`
`来显示英雄的`id`属性,另一个`
`来显示英雄的`name`属性。 + 能显示名字虽然不错,但我们还想看到这位英雄的所有属性。 + 我们将添加一个`
`来显示英雄的`id`属性,用另一个`
`来显示英雄的`name`属性。 +makeExample('toh-1/ts-snippets/app.component.snippets.pt1.ts', 'show-hero-properties') :marked @@ -153,13 +153,13 @@ code-example(format="" language="bash"). let’s take advantage of the template strings feature in ES2015 and TypeScript to maintain our sanity. - 我们可以通过字符串加法来制作更可读的模板,但这样仍然太难看了 —— 难于阅读,容易出现拼写错误。 - 这样不行!我们要借助ES2015和TypeScript提供的模板字符串来保持清醒。 + 我们可以通过字符串加法来制作更可读的模板,但这样仍然太难看了 —— 难于阅读,容易拼错。 + 这样不行!我们要借助ES2015和TypeScript提供的模板字符串来保持清爽。 Change the quotes around the template to back-ticks and put the `

`, `

` and `
` elements on their own lines. - 把模板的双引号改成反引号,并且让`

`, `

` 和 `
`标签各占一行。 + 把模板的双引号改成反引号,并且让`

`,`

`和`
`标签各占一行。 +makeExample('toh-1/ts-snippets/app.component.snippets.pt1.ts', 'multi-line-strings', 'app.component.ts (AppComponent的 模板)') @@ -174,9 +174,9 @@ code-example(format="" language="bash"). Everything between the back-ticks at the beginning and end of the template is part of a single template string. - **小心!**反引号(`)看起来很像单引号('),但它们是截然不同的字符。 - 反引号能够做的可不只是标记字符串边界。 - 在这里,我们只用它来把我们的模板变成多行的,而不涉及更多用途。 + **小心!**反引号(`)虽然看起来很像单引号('),但它们是截然不同的字符。 + 反引号能做的可不仅仅是标记字符串的边界。 + 在这里,我们只用它来把我们的模板变成多行的,而没有涉及更多用途。 所有被反引号引起来的部分,都是一个单一模板字符串的一部分。 .l-main-section @@ -190,7 +190,7 @@ code-example(format="" language="bash"). Refactor the hero name `