Getting Started
Writing content
API Documentation
Customization
Recipes
API References Develop
@ng-doc/builder / Function

CachedProperty

Generic types:TClass TProperty TCachedType

Decorator for cached properties, it will add the property name to the cachedProperties set

Presentation

function CachedProperty(
  accessor?: Partial<NgDocCacheAccessor<TCachedType, TProperty>> | undefined,
): (
  target: TClass | undefined,
  context: ClassFieldDecoratorContext<TClass, TProperty>,
) => (this: TClass, initialValue: TProperty) => TProperty;

Returns

(target: TClass | undefined, context: ClassFieldDecoratorContext<TClass, TProperty>) => (this: TClass, initialValue: TProperty) => TProperty

Parameters

NameTypeDescription
accessor
Partial<NgDocCacheAccessor<TCachedType, TProperty>> | undefined

Accessor for the cached property, it will be used to get and set the property value in the cache