diff --git a/packages/common/src/directives/ng_style.ts b/packages/common/src/directives/ng_style.ts index 659d90606a..fa41226bc7 100644 --- a/packages/common/src/directives/ng_style.ts +++ b/packages/common/src/directives/ng_style.ts @@ -12,21 +12,34 @@ import {Directive, DoCheck, ElementRef, Input, KeyValueChanges, KeyValueDiffer, * @ngModule CommonModule * * @usageNotes + * + * Set the font of the containing element to the result of an expression. + * * ``` * ... + * ``` * + * Set the width of the containing element to a pixel value returned by an expression. + * + * ``` * ... + * ``` * + * Set a collection of style values using an expression that returns key-value pairs. + * + * ``` * ... * ``` * * @description * - * Update an HTML element styles. - * - * 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'), - * - values are the values assigned to those properties (expressed in the given unit). + * An attribute directive that updates styles for the containing HTML element. + * Sets one or more style properties, specified as key-value pairs. + * The key is a style name, with an optional `.` suffix (such as 'top.px', 'font-style.em'). + * The value is an expression to be evaluated. + * The resulting non-null value, expressed in the given unit, + * is assigned to the given style property. + * If the result of evaluation is null, the corresponding style is removed. * * @publicApi */