TypeScript TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'

前端 未结 4 2073
故里飘歌
故里飘歌 2020-12-09 14:40

Im getting this compilation error in my Angular 2 app:

TS7015: Element implicitly has an \'any\' type because index expression is not of type \'number\'.
         


        
4条回答
  •  孤街浪徒
    2020-12-09 15:16

    Not the OP's direct issue but for users encountering this error for libraries not under their control, one can suppress this error is by adding:

    {
      ...
      "suppressImplicitAnyIndexErrors": true,
      ...
    }
    

    to the tsconfig.json file.

提交回复
热议问题