Can't bind to 'ngModel' since it isn't a known property of 'query-builder' error in angular2-query-builder library

77 Views Asked by At

i am using angular2-query-builder library in my project. my angular cli version is 13.0.4 and "angular2-query-builder" is "^0.6.2". i added QueryBuilderModule at app.module.ts file.

but when i am writing <query-builder [(ngModel)]='query' [config]='config'> in app.component.html file. it is showing error.

Can't bind to 'ngModel' since it isn't a known property of 'query-builder'.

  1. If 'query-builder' is an Angular component and it has 'ngModel' input, then verify that it is part of this module.
  2. If 'query-builder' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.ngtsc(-998002) app.component.ts(1, 70): Error occurs in the template of component AppComponent.

error image

can anyone help me please regarding this. please!!

i am getting Can't bind to 'ngModel' since it isn't a known property of 'query-builder' error in angular2-query-builder library in app.component.html file.

1

There are 1 best solutions below

0
On

You have to import FormsModule in your module / standalone component

  imports: [CommonModule, FormsModule]