Page Contents

Home > @loopback/repository > repository > getter

repository.getter() function

Decorator used to inject a Getter for a repository Mainly intended for usage with repository injections on relation repository factory

Signature:

function getter(nameOrClass: string | Class<Repository<Model>>): (target: Object, member: string, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;

Parameters

Parameter Type Description
nameOrClass string | Class<Repository<Model>> The repository class (ProductRepository) or a string name (‘ProductRepository’).

Returns:

(target: Object, member: string, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void