WrappedValue
表示 Pipe
转换的值已经变化了 —— 即使其引用并没有变。
Indicates that the result of a Pipe
transformation has changed even though the reference has not changed.
class WrappedValue {
static wrap(value: any): WrappedValue
static unwrap(value: any): any
static isWrapped(value: any): value is WrappedValue
constructor(value: any)
wrapped: any
}
说明
包装过的值会在变更检测期间自动解包,并保存解包过的值。
Wrapped values are unwrapped automatically during the change detection, and the unwrapped value is stored.
例子:
Example:
if (this._latestValue === this._latestReturnedValue) {
return this._latestReturnedValue;
} else {
this._latestReturnedValue = this._latestValue;
return WrappedValue.wrap(this._latestValue); // this will force update
}
静态方法
创建一个包装过的值。 Creates a wrapped value. |
如果值( Returns the underlying value of a wrapped value. Returns the given |
如果 Returns true if |
构造函数
属性
属性 | 说明 |
---|---|
wrapped: any |