From 63127dd0c04648a064845bc13475fbc8cf1eb034 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Sun, 2 Sep 2018 11:31:35 +0800 Subject: [PATCH] =?UTF-8?q?docs(API):=20=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=20NgStyle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/translations/cn/api-plan.md | 2 +- packages/common/src/directives/ng_style.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index 93a1f8fb37..1e5ff71cb2 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -32,7 +32,7 @@ [x] | core/ElementRef | 0.67 [x] | core/OnInit | 0.66 [x] | common/UpperCasePipe | 0.65 -[ ] | common/NgStyle | 0.60 +[x] | common/NgStyle | 0.60 [ ] | router/RouterOutlet | 0.59 [ ] | forms/Validators | 0.59 [ ] | common/http/HttpHeaders | 0.56 diff --git a/packages/common/src/directives/ng_style.ts b/packages/common/src/directives/ng_style.ts index 9062f05b0f..f4a25a1b7d 100644 --- a/packages/common/src/directives/ng_style.ts +++ b/packages/common/src/directives/ng_style.ts @@ -24,10 +24,19 @@ import {Directive, DoCheck, ElementRef, Input, KeyValueChanges, KeyValueDiffer, * * Update an HTML element styles. * + * 修改 HTML 元素的样式。 + * * The styles are updated according to the value of the expression evaluation: + * + * 这些样式会根据表达式的求值结果进行更新: + * * - keys are style names with an optional `.` suffix (ie 'top.px', 'font-style.em'), + * + * key 是样式名,可以带一个可选的 `.` 后缀(比如 'top.px', 'font-style.em'), + * * - values are the values assigned to those properties (expressed in the given unit). * + * value 是一些与这些属性相关的值(以指定的单位表示)。 * */ @Directive({selector: '[ngStyle]'})