pIvan / ngx-color-picker

Pure Angular color picker library.
MIT License
94 stars 17 forks source link

Can't bind to 'control' since it isn't a known property of 'chrome-picker' #76

Closed aleksander351 closed 11 months ago

aleksander351 commented 11 months ago

When implementing the chrome-picker with the angular wrapper from the example page, ngx-color-picker, version 16.1.0, we get the following error:

error NG8002: Can't bind to 'control' since it isn't a known property of 'chrome-picker'.

  1. If 'chrome-picker' is an Angular component and it has 'control' input, then verify that it is part of this module.
  2. If 'chrome-picker' 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.

8 <chrome-picker [control]="colorControl">

we imported the ColorPickerModule into our modules, as well as the component and we are importing the BrowserAnimationsModule and the BrowserModule as well.

Adding the following code makes the error go away, but it seems this solution is not advisable: schemas: [ NO_ERRORS_SCHEMA ]

The template code:

<div class="picker" *ngIf="isVisible">
    <chrome-picker [control]="colorControl">
      <div class="buttons">
        <button type="button" class="btn btn-primary" (click)="applyClick($event)">Apply</button>
      </div>
    </chrome-picker>
    <div class="overlay"></div>
  </div>
pIvan commented 11 months ago

Hi @aleksander351 is it possible to get the package.json so that I can create a test environment?

aleksander351 commented 11 months ago

Installing ngx-color-picker@15.1.0 worked for our Angular version. Thank you so much!

pIvan commented 11 months ago

I'm glad I could help.