我正在try 按照以下说明在我的Angular 应用程序中安装NGX-COLOR-PICKER:
https://www.npmjs.com/package/ngx-color-picker/v/16.0.0个
使用以下命令安装成功:
npm install ngx-color-picker --save
个
我可以运行ng serve
,并且没有出现错误.
但当我像下面这样导入它时:
import { ColorPickerModule } from 'ngx-color-picker';
@NgModule({
...
imports: [
...
ColorPickerModule
]
})
我在执行ng serve
时出现以下错误:
Error: node_modules/ngx-color-picker/lib/color-picker.directive.d.ts:108:103 - error TS2344: Type '{ colorPicker: { alias: "colorPicker"; required: false; }; cpWidth: { alias: "cpWidth"; required: false; }; cpHeight: { alias: "cpHeight"; required: false; }; cpToggle: { alias: "cpToggle"; required: false; }; ... 33 more ...; cpExtraTemplate: { ...; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
Property '"colorPicker"' is incompatible with index signature.
Type '{ alias: "colorPicker"; required: false; }' is not assignable to type 'string'.
我用的是15号角.