diff --git a/public/docs/ts/latest/quickstart.jade b/public/docs/ts/latest/quickstart.jade index 1d51c5cb34..8caf32270c 100644 --- a/public/docs/ts/latest/quickstart.jade +++ b/public/docs/ts/latest/quickstart.jade @@ -281,6 +281,7 @@ code-example(format=""). a(id="app-component") :marked **Add a component file** named *app.component.ts* and paste the following lines: + **添加一个组件文件** ,命名为 *app.component.ts* 并粘贴下列代码: +makeExample('quickstart/ts/app/app.component.ts', null, 'app/app.component.ts')(format=".") diff --git a/public/docs/ts/latest/tutorial/toh-pt2.jade b/public/docs/ts/latest/tutorial/toh-pt2.jade index 80e449e300..b8e31a3722 100644 --- a/public/docs/ts/latest/tutorial/toh-pt2.jade +++ b/public/docs/ts/latest/tutorial/toh-pt2.jade @@ -23,11 +23,13 @@ include ../_util-fns .l-main-section :marked ## Where We Left Off - ## + ## 我们刚刚到哪儿了 Before we continue with Part 2 of the Tour of Heroes, let’s verify we have the following structure after [Part 1](./toh-pt1.html). If not, we’ll need to go back to Part 1 and figure out what we missed. + 在继续《英雄之旅》的第二部分之前,我们先检查一下,完成第一部分之后,你是否已经有了如下目录结构,如果没有,你得先回到第一部分,看看缺了哪里。 + .filetree .file angular2-tour-of-heroes .children @@ -43,7 +45,10 @@ include ../_util-fns .file typings.json :marked ### Keep the app transpiling and running + ### 让应用代码保持转译和运行 We want to start the TypeScript compiler, have it watch for changes, and start our server. We'll do this by typing + + 我们要启动TypeScript编译器,它会监视文件变更,并且启动开发服务器。我们只要敲: code-example(format="." language="bash"). npm start @@ -51,13 +56,19 @@ code-example(format="." language="bash"). :marked This will keep the application running while we continue to build the Tour of Heroes. + 这个命令会在我们构建《英雄之旅》的时候让应用得以持续运行。 + .l-main-section :marked ## Displaying Our Heroes + ## 展示我们的英雄 ### Creating heroes + ### 创建英雄 Let’s create an array of ten heroes at the bottom of `app.component.ts`. + + 我们先在`app.component.ts`的底部创建一个由十位英雄组成的数组。 -+makeExample('toh-2/ts/app/app.component.ts', 'hero-array', 'app.component.ts (Hero array)') ++makeExample('toh-2/ts/app/app.component.ts', 'hero-array', 'app.component.ts (英雄数组)') :marked The `HEROES` array is of type `Hero`, the class defined in part one, @@ -65,6 +76,9 @@ code-example(format="." language="bash"). We aspire to fetch this list of heroes from a web service, but let’s take small steps first and display mock heroes. + `HEROS`变量是一个由`Hero`类的实例构成的数组,我们在第一部分定义过它。 + 我们当然希望从一个Web服务中获取这个英雄列表,但是,不要急,我们得把步子迈得小一点 —— 先用一组Mock(模拟对象)出来的英雄。 + ### Exposing heroes Let’s create a property in `AppComponent` that exposes the heroes for binding.