Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to use use ng2-ace-editor as FormControl #132

Open
manuchadha1979 opened this issue Feb 10, 2020 · 1 comment
Open

unable to use use ng2-ace-editor as FormControl #132

manuchadha1979 opened this issue Feb 10, 2020 · 1 comment

Comments

@manuchadha1979
Copy link

Hi

Does ng2-ace-editor support Form binding? I suppose so as I saw that it implements ControlValueAccessor.

I am on Angular6. I am trying to use ace-editor as a FormControl. I have added the following code in the template.

        <div ace-editor
          [(text)]="text"
          [mode]="'sql'"
          [theme]="'eclipse'"
          [options]="options"
          [readOnly]="false"
          [autoUpdateContent]="true"
          [durationBeforeCallback]="1000"
          (textChanged)="onChange($event)"
          style="min-height: 200px; width:100%; overflow: auto;"
          class="form-control" formControlName="answer" [ngClass]="validateField('answer')">
        </div>

But when I run the I see error

ERROR Error: No value accessor for form control with name: 'answer'

What I might be doing wrong?

@manuchadha1979
Copy link
Author

I think I was using it incorrectly. I was following the Directive instructions while I should have followed the Component instructions. I might be Ok. I'll test and confirm

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

No branches or pull requests

1 participant