From a0de7899000f9bef24b86e2939d4786e54185588 Mon Sep 17 00:00:00 2001 From: Robby Rabbitman Date: Tue, 1 Oct 2024 16:59:40 +0200 Subject: [PATCH] feat(ngx-control-value-accessor): expose the NgControl instance of the host (#479) Co-authored-by: Robby Rabbitman --- .../control-value-accessor/src/control-value-accessor.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/ngxtension/control-value-accessor/src/control-value-accessor.ts b/libs/ngxtension/control-value-accessor/src/control-value-accessor.ts index fbe55465..7c7576bd 100644 --- a/libs/ngxtension/control-value-accessor/src/control-value-accessor.ts +++ b/libs/ngxtension/control-value-accessor/src/control-value-accessor.ts @@ -201,8 +201,13 @@ export class NgxControlValueAccessor /** @ignore */ private readonly injector = inject(Injector); - /** @ignore */ - private readonly ngControl = inject(NgControl, { + /** + * The `NgControl` instance on this host element. If present, this `NgxControlValueAccessor` instance will be its value accessor. + * + * @see {@link NgControl} + * @see {@link NgControl.valueAccessor} + */ + public readonly ngControl = inject(NgControl, { self: true, optional: true, });