Alberplz / angular2-color-picker

Angular 2 Color Picker Directive, no dependences required.
MIT License
185 stars 82 forks source link

Can't bind to 'colorPicker' since it isn't a known property of 'input' #105

Open ghost opened 7 years ago

ghost commented 7 years ago

Just followed the instructions given. I am getting the following error while loading my page. <input [(colorPicker)]="color" [style.background]="color" [value]="color"/> Can't bind to 'colorPicker' since it isn't a known property of 'input'

Angular 2 version: 2.4.7

javierdlahoz commented 7 years ago

Same here

thanhdk commented 7 years ago

try to put ColorPickerModule to exports, example => exports: [ColorPickerModule]

nikhildhar1992 commented 7 years ago

try to put ColorPickerModule to exports, example => exports: [ColorPickerModule] I think it has to import in app.module.ts as mine is working file

Sathishchary commented 7 years ago

I am getting the same issue.

thanhdk commented 7 years ago

I think it has to import in app.module.ts as mine is working file yes, I mean try to import and export also. I have to do that to make it works

nikhildhar1992 commented 7 years ago

But since morning it's not working I have imported will check by both import and export

nothing its not working actually the issue is I have not add map in system.config.js file because I am not able to find that file in my project ionic 3 angular 2

thanhdk commented 7 years ago

You use this plugin for mobile app or web? I use it for web, not test on mobile app yet

nikhildhar1992 commented 7 years ago

I have checked on web and on mobile also it was working but don't know why I am getting error now whenever I include this ColorPickerModule in module.ts

ghost commented 7 years ago

Did anyone got this? not working even after adding to exports

thanhdk commented 7 years ago

I am not, I remember that there is another plugin like this, I think it's more stable. -> https://www.npmjs.com/package/ct-angular2-color-picker Please try this and let me know

ghost commented 7 years ago

https://www.npmjs.com/package/ct-angular2-color-picker It's just the fork of the current plug-in.

liebstein commented 7 years ago

You need to define a shared module and export ColorPickerModule


import { ColorPickerModule } from 'angular2-color-picker';

@NgModule({
  imports: [
    CommonModule,
    ColorPickerModule
  ],
  exports: [
    CommonModule,
    ColorPickerModule
  ],
  declarations: [],
  providers: []
})
export class SharedModule {

  static forRoot(): ModuleWithProviders {
    return {
      ngModule: SharedModule
    };
  }
}
biplabpokhrel commented 7 years ago

Try ngx-color-picker, this work with AOT as well, you have to export the ColorPickerModule , if you want to use colorpicker outside the current module.

ghost commented 6 years ago

Event exporting the shared module didn't work

On Thu, Jun 29, 2017 at 12:17 PM, Assaf Liebstein notifications@github.com wrote:

You need to define a shared module and export ColorPickerModule

import { ColorPickerModule } from 'ngx-color-picker';

@NgModule({ imports: [ CommonModule, ColorPickerModule ], exports: [ CommonModule, ColorPickerModule ], declarations: [], providers: [] }) export class SharedModule {

static forRoot(): ModuleWithProviders { return { ngModule: SharedModule }; } }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Alberplz/angular2-color-picker/issues/105#issuecomment-311877639, or mute the thread https://github.com/notifications/unsubscribe-auth/AKjZcUy6GCeKcsG8vBrTv60b_lGLFtHtks5sI0h5gaJpZM4NFW1s .

-- --

Thanks & Regards https://www.facebook.com/sprinklingstar Gopi Malla Senior Software Developer Gybshot Sports Solutions Pvt. Ltd. (Playcer) playcer.in http://www.autoninja.in/

+91 8884637275 +91 9866199337 www.linkedin.com/in/gopi-malla-58347462

ghost commented 3 years ago

I tried export option as well but getting the same error. Can anyone please provide me the solution of this problem. @biplabpokhrel @mallagopi999 @liebstein

jayudhandha commented 3 years ago

Any update on this issue?

I also tried the export option both in current module and app.module.ts.

Same issue in both the cases.

MorenoAlex commented 7 months ago

I have the same problem with Angular 15. Note that I had no problem with Angular 14, but after the 14->15 migration I can't seem to get rid of this error. I tried the export solution to no avail.

kakopappa commented 4 months ago

I have the same problem with Angular 15. Note that I had no problem with Angular 14, but after the 14->15 migration I can't seem to get rid of this error. I tried the export solution to no avail.

Having the same problem. did you solve it?

ivaancruzz commented 4 months ago

The same when migrating from angular 14 to 15. With this I managed to solve it: npm install ngx-color-picker@14 --save

More info