I was trying to add spinner to my angular project but got weird error:
my ngx-spinner-component.d.ts line with error: ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NgxSpinnerComponent, [null, null, null, { optional: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration<NgxSpinnerComponent, "ngx-spinner", never, { "bdColor": { "alias": "bdColor"; "required": false; }; "size": { "alias": "size"; "required": false; }; "color": { "alias": "color"; "required": false; }; "type": { "alias": "type"; "required": false; }; "fullScreen": { "alias": "fullScreen"; "required": false; }; "name": { "alias": "name"; "required": false; }; "zIndex": { "alias": "zIndex"; "required": false; }; "template": { "alias": "template"; "required": false; }; "showSpinner": { "alias": "showSpinner"; "required": false; }; "disableAnimation": { "alias": "disableAnimation"; "required": false; }; }, {}, never, ["*"], false, never>; }
Corresponding code with parameters in my service for spinner:
` busy() {
this.busyRequestCount++;
this.spinnerService.show(undefined, {
bdColor: 'rgba(255, 255, 255, 0.7)',
color: '#333333',
type: 'timer',
});
}`
Error:
error TS2344: Type '{ bdColor: { alias: "bdColor"; required: false; }; size: { alias: "size"; required: false; }; color: { alias: "color"; required: false; }; type: { alias: "type"; required: false; }; fullScreen: { alias: "fullScreen"; required: false; }; ... 4 more ...; disableAnimation: { ...; }; }' does not satisfy the constraint '{ [key: string]: string; }'. Property '"bdColor"' is incompatible with index signature. Type '{ alias: "bdColor"; required: false; }' is not assignable to type 'string'.