diff --git a/aio/content/dict/dict-1.json b/aio/content/dict/dict-1.json
index 4fd1da2823..3da37ecaf2 100644
--- a/aio/content/dict/dict-1.json
+++ b/aio/content/dict/dict-1.json
@@ -1,67322 +1,39667 @@
[
{
- "original": "# Forms",
- "translation": "# 表单",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "## Transpile",
+ "translation": "## 转译(transpile)",
+ "sourceFile": "/Users/twer/private/GDE/content-1/_fragments/glossary-t2.md"
},
{
- "original": "Forms are the mainstay of business applications.\nYou use forms to log in, submit a help request, place an order, book a flight,\nschedule a meeting, and perform countless other data-entry tasks.",
- "translation": "表单是商业应用的支柱,我们用它来执行登录、求助、下单、预订机票、安排会议,以及不计其数的其它数据录入任务。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "The process of transforming code written in one form of JavaScript\n(such as TypeScript) into another form of JavaScript (such as [ES5](_fragments/glossary-t2#es5)).",
+ "translation": "把一种形式的 JavaScript(例如 TypeScript)转换成另一种形式的 JavaScript(例如 [ES5](_fragments/glossary-t2#es5))的过程。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/_fragments/glossary-t2.md"
},
{
- "original": "In developing a form, it's important to create a data-entry experience that guides the\nuser efficiently and effectively through the workflow.",
- "translation": "在开发表单时,创建数据方面的体验是非常重要的,它能指引用户明细、高效的完成工作流程。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "## TypeScript",
+ "translation": "## TypeScript 语言",
+ "sourceFile": "/Users/twer/private/GDE/content-1/_fragments/glossary-t2.md"
},
{
- "original": "Developing forms requires design skills (which are out of scope for this page), as well as framework support for\n*two-way data binding, change tracking, validation, and error handling*,\nwhich you'll learn about on this page.",
- "translation": "开发表单需要设计能力(那超出了本章的范围),而框架支持*双向数据绑定、变更检测、验证和错误处理*,而本章我们会接触到它们。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "A version of JavaScript that supports most [ECMAScript 2015](_fragments/glossary-t2#es2015)\nlanguage features such as [decorators](_fragments/glossary-t2#decorator).",
+ "translation": "JavaScript 的一个版本,支持了几乎所有 [ECMAScript 2015](_fragments/glossary-t2#ecmascript=2015) 语言特性,例如[装饰器 (decorator)](_fragments/glossary-t2#decorator))。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/_fragments/glossary-t2.md"
},
{
- "original": "This page shows you how to build a simple form from scratch. Along the way you'll learn how to:",
- "translation": "这个页面演示了如何从草稿构建一个简单的表单。这个过程中你将学会如何:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "TypeScript is also notable for its optional typing system, which provides\ncompile-time type checking and strong tooling support (such as \"intellisense,\"\ncode completion, refactoring, and intelligent search). Many code editors\nand IDEs support TypeScript either natively or with plugins.",
+ "translation": "TypeScript 还以它的可选类型系统而著称。\n该类型系统提供了编译时类型检查和强大的工具支持(例如 “Intellisense”,代码补齐,重构和智能搜索等)。\n许多代码编辑器和 IDE 都原生支持 TypeScript 或通过插件提供支持。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/_fragments/glossary-t2.md"
},
{
- "original": "* Build an Angular form with a component and template.",
- "translation": "用组件和模板构建 Angular 表单",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "TypeScript is the preferred language for Angular development, although\nyou can use other JavaScript dialects such as [ES5](_fragments/glossary-t2#es5).",
+ "translation": "TypeScript 是 Angular 的首选语言,当然,你可以使用其它 JavaScript 方言,例如[ES5](_fragments/glossary-t2#es5)。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/_fragments/glossary-t2.md"
},
{
- "original": "* Use `ngModel` to create two-way data bindings for reading and writing input-control values.",
- "translation": "用`ngModel`创建双向数据绑定,以读取和写入输入控件的值",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Read more about TypeScript at [typescriptlang.org](http://www.typescriptlang.org/).",
+ "translation": "更多信息,见[typescript.org](http://www.typescriptlang.org/)。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/_fragments/glossary-t2.md"
},
{
- "original": "* Track state changes and the validity of form controls.",
- "translation": "跟踪状态的变化,并验证表单控件",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "# AngularJS to Angular Quick Reference",
+ "translation": "# 从 AngularJS 到 Angular 快速参考",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "* Provide visual feedback using special CSS classes that track the state of the controls.",
- "translation": "使用特殊的CSS类来跟踪控件的状态并给出视觉反馈",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "_Angular_ is the name for the Angular of today and tomorrow.\n_AngularJS_ is the name for all v1.x versions of Angular.",
+ "translation": "_Angular_ 是 Angular 现在以及未来的名字,而 _AngularJS_ 则用来专指所有 Angular 的 1.x 版本。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "* Display validation errors to users and enable/disable form controls.",
- "translation": "向用户显示验证错误提示,以及启用/禁用表单控件",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "This guide helps you transition from AngularJS to Angular\nby mapping AngularJS syntax to the equivalent Angular syntax.",
+ "translation": "本章提供了一个快速的参考指南,指出一些常用的AngularJS语法及其在Angular中的等价物。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "* Share information across HTML elements using template reference variables.",
- "translation": "使用模板引用变量在 HTML 元素之间共享信息",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "**See the Angular syntax in this **.",
+ "translation": "**参见 以学习 Angular 语法**",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You can run the in Plunker and download the code from there.",
- "translation": "你可以在Plunker中运行,并且从那里下载代码。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "## Template basics",
+ "translation": "## 模板基础",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "## Template-driven forms",
- "translation": "## 模板驱动的表单",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Templates are the user-facing part of an Angular application and are written in HTML.\nThe following table lists some of the key AngularJS template features with their equivalent Angular template syntax.",
+ "translation": "模板是Angular应用中的门面部分,它是用HTML写的。下表中是一些AngularJS中的关键模板特性及其在Angular中的等价语法。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You can build forms by writing templates in the Angular [template syntax](guide/template-syntax) with\nthe form-specific directives and techniques described in this page.",
- "translation": "通常,使用 Angular [模板语法](guide/template-syntax)编写模板,结合本章所描述的表单专用指令和技术来构建表单。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Bindings/interpolation",
+ "translation": "### 绑定/插值表达式",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You can also use a reactive (or model-driven) approach to build forms.\nHowever, this page focuses on template-driven forms.",
- "translation": "你还可以使用响应式(也叫模型驱动)的方式来构建表单。不过本章中只介绍模板驱动表单。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In AngularJS, an expression in curly braces denotes one-way binding.\n This binds the value of the element to a property in the controller\n associated with this template.",
+ "translation": "在AngularJS中,花括号中的表达式代表单向绑定。\n 它把元素的值绑定到了与模板相关控制器的属性上。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You can build almost any form with an Angular template—login forms, contact forms, and pretty much any business form.\nYou can lay out the controls creatively, bind them to data, specify validation rules and display validation errors,\nconditionally enable or disable specific controls, trigger built-in visual feedback, and much more.",
- "translation": "利用 Angular 模板,可以构建几乎所有表单 — 登录表单、联系人表单…… 以及任何的商务表单。\n 可以创造性的摆放各种控件、把它们绑定到数据、指定校验规则、显示校验错误、有条件的禁用或\n 启用特定的控件、触发内置的视觉反馈等等,不胜枚举。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "When using the `controller as` syntax,\n the binding is prefixed with the controller alias (`vm` or `$ctrl`) because you\n have to be specific about the source of the binding.",
+ "translation": "当使用`controller as`语法时,该绑定需要用控制器的别名(`vm`)为前缀,这是因为我们不得不通过它来指定绑定源。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Angular makes the process easy by handling many of the repetitive, boilerplate tasks you'd\notherwise wrestle with yourself.",
- "translation": "它用起来很简单,这是因为 Angular 处理了大多数重复、单调的任务,这让我们可以不必亲自操刀、身陷其中。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Bindings/interpolation",
+ "translation": "### 绑定/插值表达式",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You'll learn to build a template-driven form that looks like this:",
- "translation": "我们将学习构建如下的“模板驱动”表单:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In Angular, a template expression in curly braces still denotes one-way binding.\n This binds the value of the element to a property of the component.\n The context of the binding is implied and is always the\n associated component, so it needs no reference variable.",
+ "translation": "在Angular中,花括号中的模板表达式同样代表单向绑定。\n 它把元素的值绑定到了组件的属性上。\n 它绑定的上下文变量是隐式的,并且总是关联到组件。\n 所以,它不需要一个引用变量。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "The *Hero Employment Agency* uses this form to maintain personal information about heroes.\nEvery hero needs a job. It's the company mission to match the right hero with the right crisis.",
- "translation": "这里是*英雄职业介绍所*,使用这个表单来维护候选英雄们的个人信息。每个英雄都需要一份工作。\n公司的使命就是让合适的英雄去应对恰当的危机!",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information, see the [Interpolation](guide/template-syntax#interpolation)\n section of the [Template Syntax](guide/template-syntax) page.",
+ "translation": "要了解更多,请参见[模板语法](guide/template-syntax)中的[插值表达式](guide/template-syntax#interpolation)部分。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Two of the three fields on this form are required. Required fields have a green bar on the left to make them easy to spot.",
- "translation": "表单中的三个字段,其中两个是必填的。必填的字段在左侧有个绿色的竖条,方便用户分辨哪些是必填项。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Filters",
+ "translation": "### 过滤器",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "If you delete the hero name, the form displays a validation error in an attention-grabbing style:",
- "translation": "如果删除了英雄的名字,表单就会用醒目的样式把验证错误显示出来。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "To filter output in AngularJS templates, use the pipe character (|) and one or more filters.",
+ "translation": "要在AngularJS中过滤输出,使用管道字符(|)以及一个或多个过滤器。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "如果删除了英雄的名字,表单就会用醒目的样式把验证错误显示出来。",
- "translation": "",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "This example filters the `title` property to uppercase.",
+ "translation": "在这个例子中,我们把`title`属性过滤成了大写形式。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Note that the *Submit* button is disabled, and the \"required\" bar to the left of the input control changes from green to red.",
- "translation": "注意,提交按钮被禁用了,而且输入控件左侧的“必填”条从绿色变为了红色。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Pipes",
+ "translation": "### 管道",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You can customize the colors and location of the \"required\" bar with standard CSS.",
- "translation": "稍后,会使用标准 CSS 来定制“必填”条的颜色和位置。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In Angular you use similar syntax with the pipe (|) character to filter output, but now you call them **pipes**.\n Many (but not all) of the built-in filters from AngularJS are\n built-in pipes in Angular.",
+ "translation": "在Angular中,我们使用相似的语法 —— 用管道字符(|)来过滤输出,但是现在直接把它叫做**管道**了。\n 很多(但不是所有)AngularJS中的内置过滤器也成了Angular中的内置管道。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You'll build this form in small steps:",
- "translation": "我们将一点点构建出此表单:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information, see [Filters/pipes](guide/ajs-quick-reference#filters-pipes) below.",
+ "translation": "请参见下面[过滤器/管道](guide/ajs-quick-reference#filters-pipes)了解更多信息。\n ",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Create the `Hero` model class.",
- "translation": "创建`Hero`模型类",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Local variables",
+ "translation": "### 局部变量",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Create the component that controls the form.",
- "translation": "创建控制此表单的组件。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Here, `movie` is a user-defined local variable.",
+ "translation": "这里的`movie`是一个用户定义的局部变量",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Create a template with the initial form layout.",
- "translation": "创建具有初始表单布局的模板。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Input variables",
+ "translation": "### 输入变量",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Bind data properties to each form control using the `ngModel` two-way data-binding syntax.",
- "translation": "使用`ngModel`双向数据绑定语法把数据属性绑定到每个表单输入控件。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Angular has true template input variables that are explicitly defined using the `let` keyword.",
+ "translation": "在Angular中,我们有了真正的模板输入变量,它需要使用`let`关键字进行明确定义。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Add a `name` attribute to each form-input control.",
- "translation": "往每个表单输入控件上添加`name`属性 (attribute)。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information, see the [ngFor micro-syntax](guide/template-syntax#microsyntax)\n section of the [Template Syntax](guide/template-syntax) page.",
+ "translation": "要了解更多信息,请参见[模板语法](guide/template-syntax)中的[ngFor微语法](guide/template-syntax#microsyntax)部分。\n ",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Add custom CSS to provide visual feedback.",
- "translation": "添加自定义 CSS 来提供视觉反馈。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "## Template directives",
+ "translation": "## 模板指令",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Show and hide validation-error messages.",
- "translation": "显示和隐藏有效性验证的错误信息。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "AngularJS provides more than seventy built-in directives for templates.\nMany of them aren't needed in Angular because of its more capable and expressive binding system.\nThe following are some of the key AngularJS built-in directives and their equivalents in Angular.",
+ "translation": "AngularJS 为模板提供了七十多个内置指令。\n在 Angular 中,它们很多都已经不需要了,因为 Angular 有了一个更加强大、快捷的绑定系统。\n下面是一些AngularJS 中的关键指令及其在 Angular 中的等价物。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Handle form submission with *ngSubmit*.",
- "translation": "使用 **ngSubmit** 处理表单提交。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "The application startup process is called **bootstrapping**.",
+ "translation": "应用的启动过程被称为**引导**。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. Disable the form’s *Submit* button until the form is valid.",
- "translation": "禁用此表单的提交按钮,直到表单变为有效。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Although you can bootstrap an AngularJS app in code,\n many applications bootstrap declaratively with the `ng-app` directive,\n giving it the name of the application's module (`movieHunter`).",
+ "translation": "虽然可以从代码中引导Angular应用,\n 但很多应用都是通过`ng-app`指令进行声明式引导的,只要给它一个应用模块的名字(`movieHunter`)就可以了。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "## Setup",
- "translation": "## 搭建",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Bootstrapping",
+ "translation": "### 引导",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Follow the [setup](guide/setup) instructions for creating a new project\nnamed angular-forms.",
- "translation": "按照[搭建本地开发环境](guide/setup)的说明,创建一个名为angular-forms的新项目。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Angular doesn't have a bootstrap directive.\n To launch the app in code, explicitly bootstrap the application's root module (`AppModule`)\n in `main.ts`\n and the application's root component (`AppComponent`) in `app.module.ts`.",
+ "translation": "Angular 没有引导指令。\n 我们总是通过显式调用一个`bootstrap`函数,并传入应用模块的名字(`AppComponent`)来启动应用。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "## Create the Hero model class",
- "translation": "## 创建 Hero 模型类",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information see the [Setup](guide/setup) page.",
+ "translation": "要了解更多,参见[搭建本地开发环境](guide/setup)。\n ",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "As users enter form data, you'll capture their changes and update an instance of a model.\nYou can't lay out the form until you know what the model looks like.",
- "translation": "当用户输入表单数据时,需要捕获它们的变化,并更新到模型的实例中。\n除非知道模型里有什么,否则无法设计表单的布局。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In AngularJS, the `ng-class` directive includes/excludes CSS classes\n based on an expression. That expression is often a key-value control object with each\n key of the object defined as a CSS class name, and each value defined as a template expression\n that evaluates to a Boolean value.",
+ "translation": "在AngularJS中,`ng-class`指令会基于一个表达式来包含/排除某些CSS类。该表达式通常是一个“键-值”型的控制对象,\n 对象中的每一个键代表一个CSS类名,每一个值定义为一个返回布尔值的模板表达式。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "A model can be as simple as a \"property bag\" that holds facts about a thing of application importance.\nThat describes well the `Hero` class with its three required fields (`id`, `name`, `power`)\nand one optional field (`alterEgo`).",
- "translation": "最简单的模型是个“属性包”,用来存放应用中一件事物的事实。\n这里使用三个必备字段 (`id`、`name`、`power`),和一个可选字段 (`alterEgo`,译注:中文含义是第二人格,例如 X 战警中的 Jean / 黑凤凰)。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In the first example, the `active` class is applied to the element if `isActive` is true.",
+ "translation": "在第一个例子中,当`isActive`为真时,`active`类会被应用到元素上。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "In the `app` directory, create the following file with the given content:",
- "translation": "在应用文件夹中创建下列文件:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "You can specify multiple classes, as shown in the second example.",
+ "translation": "就像第二个例子中展示的,可以指定多个CSS类。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "It's an anemic model with few requirements and no behavior. Perfect for the demo.",
- "translation": "这是一个少量需求和零行为的贫血模型。对演示来说很完美。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In Angular, the `ngClass` directive works similarly.\n It includes/excludes CSS classes based on an expression.",
+ "translation": "在Angular中,`ngClass`指令用类似的方式工作。\n 它根据一个表达式包含/排除某些CSS类。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "The TypeScript compiler generates a public field for each `public` constructor parameter and\nautomatically assigns the parameter’s value to that field when you create heroes.",
- "translation": "TypeScript 编译器为每个`public`构造函数参数生成一个公共字段,在创建新的英雄实例时,自动把参数值赋给这些公共字段。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In the first example, the `active` class is applied to the element if `isActive` is true.",
+ "translation": "在第一个例子中,如果`isActive`为真,则`active`类被应用到那个元素上。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "The `alterEgo` is optional, so the constructor lets you omit it; note the question mark (?) in `alterEgo?`.",
- "translation": "`alterEgo`是可选的,调用构造函数时可省略,注意`alterEgo?`中的问号 (?)。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "You can specify multiple classes, as shown in the second example.",
+ "translation": "就像第二个例子中所展示的那样,可以同时指定多个类。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You can create a new hero like this:",
- "translation": "可以这样创建新英雄:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Angular also has **class binding**, which is a good way to add or remove a single class,\n as shown in the third example.",
+ "translation": "Angular还有**类绑定**,它是单独添加或移除一个类的好办法 —— 就像第三个例子中展示的。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "## Create a form component",
- "translation": "## 创建表单组件",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information see the [Attribute, class, and style bindings](guide/template-syntax#other-bindings) \n section of the [Template Syntax](guide/template-syntax) page.",
+ "translation": "要了解更多信息,参见[模板语法](guide/template-syntax)中的[属性、CSS类和样式绑定](guide/template-syntax#other-bindings)部分。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "An Angular form has two parts: an HTML-based _template_ and a component _class_\nto handle data and user interactions programmatically.\nBegin with the class because it states, in brief, what the hero editor can do.",
- "translation": "Angular 表单分为两部分:基于 HTML 的*模板*和组件*类*,用来程序处理数据和用户交互。\n先从组件类开始,是因为它可以简要说明英雄编辑器能做什么。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In AngularJS, the `ng-click` directive allows you to specify custom behavior when an element is clicked.",
+ "translation": "在AngularJS中,`ng-click`指令指定当元素被点击时的自定义行为。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Create the following file with the given content:",
- "translation": "创建下列文件:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In the first example, when the user clicks the button, the `toggleImage()` method in the controller referenced by the `vm` `controller as` alias is executed.",
+ "translation": "在第一个例子中,如果用户点击了这个按钮,那么控制器的`toggleImage()`方法就会被执行,这个控制器是被`controller as`中指定的`vm`别名所引用的。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "There’s nothing special about this component, nothing form-specific,\nnothing to distinguish it from any component you've written before.",
- "translation": "这个组件没有什么特别的地方,没有表单相关的东西,与之前写过的组件没什么不同。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "The second example demonstrates passing in the `$event` object, which provides details about the event\n to the controller.",
+ "translation": "第二个例子演示了传入`$event`对象,它提供了事件的详情,并被传到控制器。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Understanding this component requires only the Angular concepts covered in previous pages.",
- "translation": "只需要前面章节中学过的概念,就可以完全理解这个组件:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Bind to the `click` event",
+ "translation": "### 绑定到`click`事件",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "* The code imports the Angular core library and the `Hero` model you just created.",
- "translation": "这段代码导入了Angular核心库以及我们刚刚创建的`Hero`模型。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "AngularJS event-based directives do not exist in Angular.\n Rather, define one-way binding from the template view to the component using **event binding**.",
+ "translation": "AngularJS基于事件的指令在Angular中已经不存在了。\n 不过,可以使用**事件绑定**来定义从模板视图到组件的单向数据绑定。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "* The `@Component` selector value of \"hero-form\" means you can drop this form in a parent template with a `` tag.",
- "translation": "`@Component`选择器“hero-form”表示可以用``标签把这个表单放进父模板。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For event binding, define the name of the target event within parenthesis and\n specify a template statement, in quotes, to the right of the equals. Angular then\n sets up an event handler for the target event. When the event is raised, the handler\n executes the template statement.",
+ "translation": "要使用事件绑定,把目标事件的名字放在圆括号中,并且使用等号右侧引号中的模板语句对它赋值。\n 然后Angular为这个目标时间设置事件处理器。当事件被触发时,这个处理器就会执行模板语句。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "* The `templateUrl` property points to a separate file for the template HTML.",
- "translation": "`moduleId: module.id`属性设置了基地址,用于从相对模块路径加载`templateUrl`。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In the first example, when a user clicks the button, the `toggleImage()` method in the associated component is executed.",
+ "translation": "在第一个例子中,当用户点击此按钮时,相关组件中的`toggleImage()`方法就被执行了。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "* You defined dummy data for `model` and `powers`, as befits a demo.",
- "translation": "`templateUrl`属性指向一个独立的 HTML 模板文件。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "The second example demonstrates passing in the `$event` object, which provides details about the event\n to the component.",
+ "translation": "第二个例子演示了如何传入`$event`对象,它为组件提供了此事件的详情。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Down the road, you can inject a data service to get and save real data\nor perhaps expose these properties as inputs and outputs\n(see [Input and output properties](guide/template-syntax#inputs-outputs) on the\n[Template Syntax](guide/template-syntax) page) for binding to a\nparent component. This is not a concern now and these future changes won't affect the form.",
- "translation": "接下来,我们可以注入一个数据服务,以获取或保存真实的数据,或者把这些属性暴露为输入属性和输出属性(参见[Template Syntax](guide/template-syntax)中的[输入和输出属性](guide/template-syntax#inputs-outputs))来绑定到一个父组件。这不是现在需要关心的问题,未来的更改不会影响到这个表单。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For a list of DOM events, see: https://developer.mozilla.org/en-US/docs/Web/Events.",
+ "translation": "要查看DOM事件的列表,请参见[网络事件](https://developer.mozilla.org/en-US/docs/Web/Events)。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "* You added a `diagnostic` property to return a JSON representation of the model.\nIt'll help you see what you're doing during development; you've left yourself a cleanup note to discard it later.",
- "translation": "我们添加一个`diagnostic`属性,以返回这个模型的 JSON 形式。在开发过程中,它用于调试,最后清理时会丢弃它。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information, see the [Event binding](guide/template-syntax#event-binding) \n section of the [Template Syntax](guide/template-syntax) page.",
+ "translation": "要了解更多,请参见[模板语法](guide/template-syntax)中的[事件绑定](guide/template-syntax#event-binding)部分。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "### Why the separate template file?",
- "translation": "### 为何分离模板文件?",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In AngularJS, the `ng-controller` directive attaches a controller to the view.\n Using the `ng-controller` (or defining the controller as part of the routing) ties the\n view to the controller code associated with that view.",
+ "translation": "在AngularJS中,`ng-controller`指令把控制器附加到视图上。\n 使用`ng-controller`(或把控制器定义为路由的一部分)把视图及其控制器的代码联系在一起。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Why don't you write the template inline in the component file as you often do elsewhere?",
- "translation": "为什么不与我们在其他地方常常做的那样,以内联的方式把模板写在组件文件中呢?",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Component decorator",
+ "translation": "### Component装饰器",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "There is no \"right\" answer for all occasions. Inline templates are useful when they are short.\nMost form templates aren't short. TypeScript and JavaScript files generally aren't the best place to\nwrite (or read) large stretches of HTML, and few editors help with files that have a mix of HTML and code.",
- "translation": "没有什么答案在所有场合都总是“正确”的。当模板足够短的时候,内联形式更招人喜欢。\n但大多数的表单模板都不短。通常,TypeScript 和 JavaScript 文件不是写(读)大型 HTML 的好地方,\n而且没有几个编辑器能对混写的 HTML 和代码提供足够的帮助。\n我们还是喜欢内容清晰、目标明确的短文件,像这个一样。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In Angular, the template no longer specifies its associated controller.\n Rather, the component specifies its associated template as part of the component class decorator.",
+ "translation": "在Angular中,模板不用再指定它相关的控制器。\n 反过来,组件会在组件类的装饰器中指定与它相关的模板。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Form templates tend to be large, even when displaying a small number of fields,\nso it's usually best to put the HTML template in a separate file.\nYou'll write that template file in a moment. First,\nrevise the `app.module.ts` and `app.component.ts` to make use of the new `HeroFormComponent`.",
- "translation": "就算是在仅仅显示少数表单项目时,表单模板一般都比较庞大。所以通常最好的方式是将 HTML 模板放到单独的文件中。\n一会儿将编写这个模板文件。在这之前,先退一步,再看看`app.module.ts`和`app.component.ts`,让它们使用新的`HeroFormComponent`。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information, see [Architecture Overview](guide/architecture#components).",
+ "translation": "要了解更多,请参见[架构概览](guide/architecture#components)。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "## Revise *app.module.ts*",
- "translation": "## 修改 *app.module.ts*",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### ng-hide\n In AngularJS, the `ng-hide` directive shows or hides the associated HTML element based on\n an expression. For more information, see [ng-show](guide/ajs-quick-reference#ng-show).",
+ "translation": "在AngularJS中,`ng-hide`指令会基于一个表达式显示或隐藏相关的HTML元素。\n 参见[ng-show](guide/ajs-quick-reference#ng-show)了解更多。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "`app.module.ts` defines the application's root module. In it you identify the external modules you'll use in the application\nand declare the components that belong to this module, such as the `HeroFormComponent`.",
- "translation": "`app.module.ts`定义了应用的根模块。其中标识即将用到的外部模块,以及声明属于本模块中的组件,例如`HeroFormComponent`。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Bind to the `hidden` property",
+ "translation": "### 绑定`hidden`属性",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Because template-driven forms are in their own module, you need to add the `FormsModule` to the array of\n`imports` for the application module before you can use forms.",
- "translation": "因为模板驱动的表单位于它们自己的模块,所以在使用表单之前,需要将`FormsModule`添加到应用模块的`imports`数组中。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In Angular, you use property binding; there is no built-in *hide* directive.\n For more information, see [ng-show](guide/ajs-quick-reference#ng-show).",
+ "translation": "在Angular中,并没有一个内置的*hide*指令,可以改用属性绑定。\n 参见[ng-show](guide/ajs-quick-reference#ng-show)了解更多。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Replace the contents of the \"QuickStart\" version with the following:",
- "translation": "把“快速上手”版的文件替换为如下内容:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "The `ng-href` directive allows AngularJS to preprocess the `href` property so that it\n can replace the binding expression with the appropriate URL before the browser\n fetches from that URL.",
+ "translation": "`ng-href`指令允许AngularJS对`href`属性进行预处理,以便它能在浏览器获取那个URL之前,使用一个返回适当URL的绑定表达式替换它。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "There are three changes:",
- "translation": "有三处更改:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In AngularJS, the `ng-href` is often used to activate a route as part of navigation.",
+ "translation": "在AngularJS 中,`ng-href`通常用来作为导航的一部分,激活一个路由。\n \n <a ng-href=\"#movies\">Movies</a>\n ",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. You import `FormsModule` and the new `HeroFormComponent`.",
- "translation": "导入`FormsModule`和新组件`HeroFormComponent`。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Routing is handled differently in Angular.",
+ "translation": "路由在Angular中的处理方式不同。\n ",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. You add the `FormsModule` to the list of `imports` defined in the `@NgModule` decorator. This gives the application\naccess to all of the template-driven forms features, including `ngModel`.",
- "translation": "把`FormsModule`添加到`ngModule`装饰器的`imports`列表中,这样应用就能访问模板驱动表单的所有特性,包括`ngModel`。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "### Bind to the `href` property",
+ "translation": "### 绑定到`href`属性",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "1. You add the `HeroFormComponent` to the list of `declarations` defined in the `@NgModule` decorator. This makes\nthe `HeroFormComponent` component visible throughout this module.",
- "translation": "把`HeroFormComponent`添加到`ngModule`装饰器的`declarations`列表中,使`HeroFormComponent`组件在整个模块中可见。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "Angular uses property binding; there is no built-in *href* directive.\n Place the element's `href` property in square brackets and set it to a quoted template expression.",
+ "translation": "在Angular中,并没有内置的*href*指令,改用属性绑定。\n 我们把元素的`href`属性放在方括号中,并把它设成一个引号中的模板表达式。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "If a component, directive, or pipe belongs to a module in the `imports` array, _don't_ re-declare it in the `declarations` array.\nIf you wrote it and it should belong to this module, _do_ declare it in the `declarations` array.",
- "translation": "如果某个组件、指令或管道是属于`imports`中所导入的某个模块的,那就_不能再_把它再声明到本模块的`declarations`数组中。\n如果它是你自己写的,并且确实属于当前模块,*才应该*把它声明在`declarations`数组中。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information see the [Property binding](guide/template-syntax#property-binding) \n section of the [Template Syntax](guide/template-syntax) page.",
+ "translation": "要了解[属性绑定](guide/template-syntax#property-binding)的更多知识,参见[模板语法](guide/template-syntax)。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "## Revise *app.component.ts*",
- "translation": "## 修改 *app.component.ts*",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In Angular, `href` is no longer used for routing. Routing uses `routerLink`, as shown in the following example.",
+ "translation": "在Angular中,`href`不再用作路由,而是改用第三个例子中所展示的`routerLink`指令。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "`AppComponent` is the application's root component. It will host the new `HeroFormComponent`.",
- "translation": "`AppComponent`是应用的根组件,`HeroFormComponent`将被放在其中。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information on routing, see the [RouterLink binding](guide/router#router-link) \n section of the [Routing & Navigation](guide/router) page.",
+ "translation": "要了解关于路由的更多信息,请参见[路由与导航](guide/router)的[RouterLink绑定](guide/router#router-link)部分。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Replace the contents of the \"QuickStart\" version with the following:",
- "translation": "把“快速上手”的版本内容替换成下列代码:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In AngularJS, the `ng-if` directive removes or recreates a portion of the DOM,\n based on an expression. If the expression is false, the element is removed from the DOM.",
+ "translation": "在AngularJS中,`ng-if`指令会根据一个表达式来移除或重建DOM中的一部分。如果表达式为假,元素就会被从DOM中移除。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "There are only two changes.\nThe `template` is simply the new element tag identified by the component's `selector` property.\nThis displays the hero form when the application component is loaded.\nYou've also dropped the `name` field from the class body.",
- "translation": "这里只做了两处修改。\n`template`中只剩下这个新的元素标签,即组件的`selector`属性。这样当应用组件被加载时,就会显示这个英雄表单。\n另外,我们还从类中移除了`name`字段。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In this example, the `
` element is removed from the DOM unless the `movies` array has a length greater than zero.",
+ "translation": "在这个例子中,除非`movies`数组的长度大于0,否则`
`元素就会被从DOM中移除。\n ",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "## Create an initial HTML form template",
- "translation": "## 创建初始 HTML 表单模板",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "The `*ngIf` directive in Angular works the same as the `ng-if` directive in AngularJS. It removes \n or recreates a portion of the DOM based on an expression.",
+ "translation": "Angular中的`*ngIf`指令与AngularJS中的`ng-if`指令一样,\n 它根据表达式的值移除或重建DOM中的一部分。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "Create the template file with the following contents:",
- "translation": "用下列内容新建模板文件:",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In this example, the `
` element is removed from the DOM unless the `movies` array has a length.",
+ "translation": "在这个例子中,除非`movies`数组的长度大于0,否则`
`元素就会被从DOM中移除。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "The language is simply HTML5. You're presenting two of the `Hero` fields, `name` and `alterEgo`, and\nopening them up for user input in input boxes.",
- "translation": "这只是一段普通的旧式 HTML 5 代码。这里有两个`Hero`字段,`name`和`alterEgo`,供用户输入。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "The (*) before `ngIf` is required in this example.\n For more information, see [Structural Directives](guide/structural-directives).",
+ "translation": "在这个例子中`ngIf`前的星号(*)是必须的。\n 要了解更多信息,参见[结构型指令](guide/structural-directives)。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "The *Name* `` control has the HTML5 `required` attribute;\nthe *Alter Ego* `` control does not because `alterEgo` is optional.",
- "translation": "*Name* ``控件具有 HTML5 的`required`属性;但 *Alter Ego* ``控件没有,因为`alterEgo`字段是可选的。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In AngularJS, the `ng-model` directive binds a form control to a property in the controller associated with the template.\n This provides **two-way binding**, whereby any change made to the value in the view is synchronized with the model, and any change to the model is synchronized with the value in the view.",
+ "translation": "在Angular1中,`ng-model`指令把一个表单控件绑定到了模板相关控制器的一个属性上。\n 这提供了**双向绑定**功能,因此,任何对视图中值的改动,都会同步到模型中,对模型的改动,也会同步到视图中。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "You added a *Submit* button at the bottom with some classes on it for styling.",
- "translation": "在底部添加个 *Submit* 按钮,它还带一些 CSS 样式类。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "In Angular, **two-way binding** is denoted by `[()]`, descriptively referred to as a \"banana in a box\". This syntax is a shortcut for defining both property binding (from the component to the view)\n and event binding (from the view to the component), thereby providing two-way binding.",
+ "translation": "在Angular中,**双向绑定**使用[()]标记出来,它被形象的比作“盒子中的香蕉”。\n 这种语法是一个简写形式,用来同时定义一个属性绑定(从组件到视图)和一个事件绑定(从视图到组件),因此,我们得到了双向绑定。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "*You're not using Angular yet*. There are no bindings or extra directives, just layout.",
- "translation": "**我们还没有真正用到Angular**。没有绑定,没有额外的指令,只有布局。",
- "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/_fragments/glossary-t2.md"
+ "original": "For more information on two-way binding with `ngModel`, see the [NgModel—Two-way binding to \n form elements with `[(ngModel)]`](../guide/template-syntax.html#ngModel) \n section of the [Template Syntax](guide/template-syntax) page.",
+ "translation": "要了解使用ngModel进行双向绑定的更多知识,参见[模板语法](guide/template-syntax)中的[NgModel—使用`[(ngModel)]`进行双向绑定](../guide/template-syntax.html#ngModel)部分。",
+ "sourceFile": "/Users/twer/private/GDE/content-1/guide/ajs-quick-reference.md"
},
{
- "original": "In template driven forms, if you've imported `FormsModule`, you don't have to do anything\nto the `