1
|
/**
|
2
|
* @license
|
3
|
* Copyright Google Inc. All Rights Reserved.
|
4
|
*
|
5
|
* Use of this source code is governed by an MIT-style license that can be
|
6
|
* found in the LICENSE file at https://angular.io/license
|
7
|
*/
|
8
|
import { DoCheck, ElementRef, KeyValueDiffers, Renderer } from '@angular/core';
|
9
|
/**
|
10
|
* @ngModule CommonModule
|
11
|
*
|
12
|
* @whatItDoes Update an HTML element styles.
|
13
|
*
|
14
|
* @howToUse
|
15
|
* ```
|
16
|
* <some-element [ngStyle]="{'font-style': styleExp}">...</some-element>
|
17
|
*
|
18
|
* <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element>
|
19
|
*
|
20
|
* <some-element [ngStyle]="objExp">...</some-element>
|
21
|
* ```
|
22
|
*
|
23
|
* @description
|
24
|
*
|
25
|
* The styles are updated according to the value of the expression evaluation:
|
26
|
* - keys are style names with an optional `.<unit>` suffix (ie 'top.px', 'font-style.em'),
|
27
|
* - values are the values assigned to those properties (expressed in the given unit).
|
28
|
*
|
29
|
* @stable
|
30
|
*/
|
31
|
export declare class NgStyle implements DoCheck {
|
32
|
private _differs;
|
33
|
private _ngEl;
|
34
|
private _renderer;
|
35
|
private _ngStyle;
|
36
|
private _differ;
|
37
|
constructor(_differs: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer);
|
38
|
ngStyle: {
|
39
|
[key: string]: string;
|
40
|
};
|
41
|
ngDoCheck(): void;
|
42
|
private _applyChanges(changes);
|
43
|
private _setStyle(nameAndUnit, value);
|
44
|
}
|