docs(common): minor corrections/improvements for NgClass (#12327)
This commit is contained in:
parent
c27ce7318f
commit
02f1222a8d
@ -11,8 +11,6 @@ import {CollectionChangeRecord, Directive, DoCheck, ElementRef, Input, IterableD
|
|||||||
import {isListLikeIterable} from '../facade/collection';
|
import {isListLikeIterable} from '../facade/collection';
|
||||||
import {isPresent} from '../facade/lang';
|
import {isPresent} from '../facade/lang';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngModule CommonModule
|
* @ngModule CommonModule
|
||||||
*
|
*
|
||||||
@ -31,11 +29,11 @@ import {isPresent} from '../facade/lang';
|
|||||||
*
|
*
|
||||||
* @description
|
* @description
|
||||||
*
|
*
|
||||||
* The CSS classes are updated as follow depending on the type of the expression evaluation:
|
* The CSS classes are updated as follows, depending on the type of the expression evaluation:
|
||||||
* - `string` - the CSS classes listed in a string (space delimited) are added,
|
* - `string` - the CSS classes listed in the string (space delimited) are added,
|
||||||
* - `Array` - the CSS classes (Array elements) are added,
|
* - `Array` - the CSS classes declared as Array elements are added,
|
||||||
* - `Object` - keys are CSS class names that get added when the expression given in the value
|
* - `Object` - keys are CSS classes that get added when the expression given in the value
|
||||||
* evaluates to a truthy value, otherwise class are removed.
|
* evaluates to a truthy value, otherwise they are removed.
|
||||||
*
|
*
|
||||||
* @stable
|
* @stable
|
||||||
*/
|
*/
|
||||||
@ -50,7 +48,6 @@ export class NgClass implements DoCheck {
|
|||||||
private _iterableDiffers: IterableDiffers, private _keyValueDiffers: KeyValueDiffers,
|
private _iterableDiffers: IterableDiffers, private _keyValueDiffers: KeyValueDiffers,
|
||||||
private _ngEl: ElementRef, private _renderer: Renderer) {}
|
private _ngEl: ElementRef, private _renderer: Renderer) {}
|
||||||
|
|
||||||
|
|
||||||
@Input('class')
|
@Input('class')
|
||||||
set klass(v: string) {
|
set klass(v: string) {
|
||||||
this._applyInitialClasses(true);
|
this._applyInitialClasses(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user