Home > Mobile >  Typescript, Angular Material, get and set accessor must have the same datatype
Typescript, Angular Material, get and set accessor must have the same datatype

Time:12-19

After installing @angular/material version^13.1.1. I have a lot of Typescript errors (2307) :

'get' and 'set' accessor must have the same datatype.

I have used

ng add @angular/material

example in \node_modules@angular\material\checkbox\checkbox.d.ts :

get disabled(): boolean;
set disabled(disabled: BooleanInput);

My Typescript version : ~4.5.2.

As far as I can see this cannot be resolved changing a parameter in tsconfig.json.

CodePudding user response:

This must be a bug on the version 13.1.1 of angular material. There is already a bug issue for that case reported.

I have checked the repo. Switching back to version 13.1.0 should fix your error until they provide some newer version with the issue fixed.

  • Related