Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Not sure If I am correct, I also find it hard to understand on how to correctly implements custom value accessor. #1956

Open
bll55020674 opened this issue Mar 27, 2021 · 1 comment

Comments

@bll55020674
Copy link

Not sure If I am correct, I also find it hard to understand on how to correctly implements custom value accessor.

Did you try to bind NgControl to you ValueAccessor ?

final NgControl ngControl;

ContentEditableDirective(this._element, @Self() @Optional() this.ngControl) {
   ngControl?.valueAccessor = this;
}

void ngOnDestroy() {
  ngControl?.valueAccessor = null;
}

The other possible solution would be to inject you value accessor like it's done for DefaultValueAccessor

Originally posted by @lejard-h in #1941 (comment)

@lejard-h
Copy link
Contributor

@bll55020674 any reason to repost my comments here ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants