On this page
WrappedValue
class
npm Package | @angular/core |
---|---|
Module | import { WrappedValue } from '@angular/core'; |
Source | core/src/change_detection/change_detection_util.ts |
Overview
class WrappedValue {
constructor(value: any)
static wrap(value: any): WrappedValue
static unwrap(value: any): any
static isWrapped(value: any): value is WrappedValue
wrapped: any
}
Description
Indicates that the result of a Pipe
transformation has changed even though the reference has not changed.
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
}
Static Members
static wrap(value: any): WrappedValue
Creates a wrapped value.
static unwrap(value: any): any
Returns the underlying value of a wrapped value. Returns the given value
when it is not wrapped.
static isWrapped(value: any): value is WrappedValue
Returns true if value
is a wrapped value.
Constructor
constructor(value: any)
Members
wrapped: any
© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/core/WrappedValue